00001 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*- 00002 //---------------------------------------------------------------------- 00013 //---------------------------------------------------------------------- 00014 #ifndef ICL_CORE_THREAD_MUTEX_IMPL_POSIX_H_INCLUDED 00015 #define ICL_CORE_THREAD_MUTEX_IMPL_POSIX_H_INCLUDED 00016 00017 #include "icl_core/TimeSpan.h" 00018 #include "icl_core/TimeStamp.h" 00019 #include "icl_core_thread/MutexImpl.h" 00020 00021 namespace icl_core { 00022 namespace thread { 00023 00024 class MutexImplPosix : public MutexImpl, protected virtual icl_core::Noncopyable 00025 { 00026 public: 00027 MutexImplPosix(); 00028 virtual ~MutexImplPosix(); 00029 00030 virtual bool lock(); 00031 virtual bool lock(const ::icl_core::TimeStamp& timeout); 00032 virtual bool lock(const ::icl_core::TimeSpan& timeout); 00033 virtual bool tryLock(); 00034 virtual void unlock(); 00035 00036 private: 00037 pthread_mutex_t *m_mutex; 00038 }; 00039 00040 } 00041 } 00042 00043 #endif