00001 // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*- 00002 //---------------------------------------------------------------------- 00013 //---------------------------------------------------------------------- 00014 #ifndef ICL_CORE_THREAD_RWLOCK_IMPL_H_INCLUDED 00015 #define ICL_CORE_THREAD_RWLOCK_IMPL_H_INCLUDED 00016 00017 #include <icl_core/Noncopyable.h> 00018 #include <icl_core/TimeSpan.h> 00019 #include <icl_core/TimeStamp.h> 00020 00021 namespace icl_core { 00022 namespace thread { 00023 00024 class RWLockImpl : protected virtual icl_core::Noncopyable 00025 { 00026 public: 00027 virtual ~RWLockImpl() {} 00028 00029 virtual bool readLock() = 0; 00030 virtual bool readLock(const icl_core::TimeSpan& timeout) = 0; 00031 virtual bool readLock(const icl_core::TimeStamp& timeout) = 0; 00032 virtual bool tryReadLock() = 0; 00033 00034 virtual bool writeLock() = 0; 00035 virtual bool writeLock(const icl_core::TimeSpan& timeout) = 0; 00036 virtual bool writeLock(const icl_core::TimeStamp& timeout) = 0; 00037 virtual bool tryWriteLock() = 0; 00038 00039 virtual void unlock() = 0; 00040 }; 00041 00042 } 00043 } 00044 00045 #endif