#ifndef ROOT_TRWLock #define ROOT_TRWLock //+SEQ,CopyRight,T=NOINCLUDE. ////////////////////////////////////////////////////////////////////////// // // // TRWLock // // // // This class implements a reader/writer lock. A rwlock allows // // a resource to be accessed by multiple reader threads but only // // one writer thread. // // // ////////////////////////////////////////////////////////////////////////// #ifndef ROOT_TObject //*KEEP,TObject. #include "TObject.h" //*KEND. #endif #ifndef ROOT_TMutex //*KEEP,TMutex,T=C++. #include "TMutex.h" //*KEND. #endif #ifndef ROOT_TCondition //*KEEP,TCondition,T=C++. #include "TCondition.h" //*KEND. #endif class TRWLock : public TObject { private: Int_t fReaders; Int_t fWriters; TMutex fMutex; TCondition fLockFree; public: TRWLock(); virtual ~TRWLock() { } Int_t ReadLock(); Int_t ReadUnLock(); Int_t WriteLock(); Int_t WriteUnLock(); ClassDef(TRWLock,0) // Reader/writer lock }; #endif