00001 // @(#)root/thread:$Id: TPosixCondition.h 20882 2007-11-19 11:31:26Z rdm $ 00002 // Author: Fons Rademakers 01/07/97 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 00012 #ifndef ROOT_TPosixCondition 00013 #define ROOT_TPosixCondition 00014 00015 00016 ////////////////////////////////////////////////////////////////////////// 00017 // // 00018 // TPosixCondition // 00019 // // 00020 // This class provides an interface to the posix condition variable // 00021 // routines. // 00022 // // 00023 ////////////////////////////////////////////////////////////////////////// 00024 00025 #ifndef ROOT_TConditionImp 00026 #include "TConditionImp.h" 00027 #endif 00028 00029 #ifndef __CINT__ 00030 #include <pthread.h> 00031 #else 00032 struct pthread_cond_t; 00033 #endif 00034 00035 class TMutexImp; 00036 class TPosixMutex; 00037 00038 00039 class TPosixCondition : public TConditionImp { 00040 00041 private: 00042 pthread_cond_t fCond; // the pthread condition variable 00043 TPosixMutex *fMutex; // mutex used around Wait() and TimedWait() 00044 00045 public: 00046 TPosixCondition(TMutexImp *m); 00047 virtual ~TPosixCondition(); 00048 00049 Int_t Wait(); 00050 Int_t TimedWait(ULong_t secs, ULong_t nanoSecs = 0); 00051 Int_t Signal(); 00052 Int_t Broadcast(); 00053 00054 ClassDef(TPosixCondition,0) // Posix condition variable 00055 }; 00056 00057 #endif