#ifndef ROOT_TSemaphore #define ROOT_TSemaphore //+SEQ,CopyRight,T=NOINCLUDE. ////////////////////////////////////////////////////////////////////////// // // // TSemaphore // // // // This class implements a counting semaphore. Use a semaphore // // to synchronize threads. // // // ////////////////////////////////////////////////////////////////////////// #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 TSemaphore : public TObject { private: TMutex fMutex; TCondition fCond; Int_t fValue; public: TSemaphore(UInt_t initial = 1); virtual ~TSemaphore() { } Int_t Wait(); Int_t TryWait(); Int_t Post(); ClassDef(TSemaphore,0) // Counting semaphore class }; #endif