00001 #ifndef __J2K__PThread_Mutex_HPP__
00002 #define __J2K__PThread_Mutex_HPP__
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include <pthread.h>
00016
00017 class Lock;
00018
00019 class Mutex {
00020 public:
00021 Mutex();
00022 virtual ~Mutex();
00023
00024 protected:
00025 virtual void lock();
00026 virtual void unlock();
00027 virtual void wait();
00028
00029 private:
00030 Mutex(const Mutex& src );
00031 Mutex& operator=(const Mutex& right);
00032 void notify();
00033 void notifyAll();
00034
00035 private:
00036 pthread_mutex_t mutex;
00037 pthread_mutexattr_t mutexAttr;
00038 pthread_cond_t cond;
00039 pthread_condattr_t condAttr;
00040
00041 friend class Lock;
00042 };
00043
00044 #include <j2k/Fred/PThread/Lock.hpp>
00045 #include <j2k/Fred/PThread/Lock.cpp>
00046
00047 #endif