00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef WT_MUTEX_H
00022 #define WT_MUTEX_H
00023
00024 #ifdef __extern_c
00025 extern "C" {
00026 #endif
00027
00028 #include <pthread.h>
00029
00030 #ifdef __extern_c
00031 }
00032 #endif
00033
00034 namespace Wefts {
00035
00045 class Mutex {
00046 protected:
00047 pthread_mutex_t m_mutex;
00048
00049 public:
00051 Mutex() { pthread_mutex_init( &m_mutex, NULL ); }
00052
00056 ~Mutex() { pthread_mutex_destroy( &m_mutex ); }
00057
00062 virtual inline void lock() { pthread_mutex_lock( &m_mutex); }
00063
00069 virtual inline void unlock() { pthread_mutex_unlock( &m_mutex ); }
00070 };
00071
00072 }
00073 #endif
00074