Libbarrett
1.2.4
|
00001 /* 00002 * real_time_mutex.h 00003 * 00004 * Created on: Dec 15, 2009 00005 * Author: dc 00006 */ 00007 00008 #ifndef BARRETT_THREAD_REAL_TIME_MUTEX_H_ 00009 #define BARRETT_THREAD_REAL_TIME_MUTEX_H_ 00010 00011 00012 #include <barrett/detail/ca_macro.h> 00013 #include <barrett/thread/abstract/mutex.h> 00014 00015 00016 namespace barrett { 00017 namespace thread { 00018 00019 00020 namespace detail { 00021 class mutex_impl; // OS-dependent implementation 00022 } 00023 00024 00025 class RealTimeMutex : public Mutex { 00026 public: 00027 RealTimeMutex(); 00028 virtual ~RealTimeMutex(); 00029 00030 virtual void lock(); 00031 virtual bool try_lock(); 00032 virtual void unlock(); 00033 00034 virtual int fullUnlock(); 00035 virtual void relock(int lc); 00036 00037 protected: 00038 detail::mutex_impl* mutex; 00039 int lockCount; 00040 00041 private: 00042 DISALLOW_COPY_AND_ASSIGN(RealTimeMutex); 00043 }; 00044 00045 00046 } 00047 } 00048 00049 00050 #endif /* BARRETT_THREAD_REAL_TIME_MUTEX_H_ */