#ifndef ROOT_TCondition #define ROOT_TCondition //+SEQ,CopyRight,T=NOINCLUDE. ////////////////////////////////////////////////////////////////////////// // // // TCondition // // // // This class implements a condition variable. Use a condition variable // // to signal threads. The actual work is done via the TConditionImp // // class (either TPosixCondition, TSolarisCondition or TNTCondition). // // // ////////////////////////////////////////////////////////////////////////// #ifndef ROOT_TObject //*KEEP,TObject. #include "TObject.h" //*KEND. #endif #ifndef ROOT_TConditionImp //*KEEP,TConditionImp,T=C++. #include "TConditionImp.h" //*KEND. #endif class TMutex; class TCondition : public TObject { private: TConditionImp *fConditionImp; // pointer to condition variable implementation TMutex *fMutex; // mutex used around Wait() and TimedWait() public: TCondition(TMutex *m = 0); virtual ~TCondition(); TMutex *GetMutex() const; Int_t Wait(); Int_t TimedWait(ULong_t secs, ULong_t nanoSecs = 0); Int_t Signal() { if (fConditionImp) return fConditionImp->Signal(); return -1; } Int_t Broadcast() { if (fConditionImp) return fConditionImp->Broadcast(); return -1; } ClassDef(TCondition,0) // Condition variable class }; #endif