Main Page   Class Hierarchy   Compound List   File List   Compound Members  

CAVERNts_mutex_c.hxx

00001 /******************************************************************
00002  * CAVERNsoft
00003  * Copyright (C) 1994-2000 Electronic Visualization Laboratory,
00004  * all rights reserved
00005  * By Jason Leigh, Yong-joo Cho, Naveen Krishnaprasad, Chris Scharver,
00006  * Stuart Bailey, Atul Nayak, Shalini Venkataraman
00007  * University of Illinois at Chicago
00008  * 
00009  * This publication and its text and code may not be copied for commercial 
00010  * use without the express written permission of the University of Illinois
00011  * at Chicago.
00012  * The contributors disclaim any representation of warranty: use this
00013  * code at your own risk.
00014  * Direct questions, comments etc to cavern@evl.uic.edu
00015  ******************************************************************/
00016 
00017 #ifndef _CAVERNPLUS_MUTEX_C
00018 #define _CAVERNPLUS_MUTEX_C
00019 
00020 #ifdef CAVERN_USE_GLOBUS_THREADS
00021 #include "globus_common.h"
00022 #endif
00023 
00024 #ifdef CAVERN_USE_PTHREADS
00025 #include <pthread.h>
00026 #endif
00027 
00028 #ifdef CAVERN_USE_GLOBUS_THREADS
00029         #include "globus_common.h"
00030         typedef globus_mutex_t CAVERN_MUTEX_T;
00031 #elif defined(CAVERN_USE_PTHREADS)
00032         #include <pthread.h>
00033         typedef pthread_mutex_t CAVERN_MUTEX_T;
00034 #elif defined(CAVERN_USE_WINDOWSTHREADS)
00035         #include <windows.h>
00036         typedef HANDLE CAVERN_MUTEX_T;
00037 #else
00038         #error One of CAVERN_USE_GLOBUS_THREADS, CAVERN_USE_PTHREADS, or CAVERN_USE_WINDOWSTHREADS must be defined.
00039 #endif
00040 
00047 class CAVERNts_mutex_c {
00048 public:
00049 
00050         enum mutexDebug_t {
00051                 DEBUG_ON, DEBUG_OFF
00052         };
00053 
00055         CAVERNts_mutex_c();
00056 
00058         void lock();
00059 
00061         void unlock();
00062 
00064         void setMutexDebug(CAVERNts_mutex_c::mutexDebug_t stat);
00065 
00067         void setMutexDebugMesg(char *msg);
00068 
00070         ~CAVERNts_mutex_c();
00071 
00073         CAVERN_MUTEX_T * getMutex();
00074 
00075 private:
00076         CAVERN_MUTEX_T mutex;
00077         mutexDebug_t debugStat;
00078         char *debugMsg;
00079 };
00080 
00081 #endif

Generated at Mon Jul 2 14:24:43 2001 for CAVERNsoft by doxygen1.2.8-20010617 written by Dimitri van Heesch, © 1997-2001