Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TPosixCondition.h
Go to the documentation of this file.
1 // @(#)root/thread:$Id$
2 // Author: Fons Rademakers 01/07/97
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TPosixCondition
13 #define ROOT_TPosixCondition
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TPosixCondition //
19 // //
20 // This class provides an interface to the posix condition variable //
21 // routines. //
22 // //
23 //////////////////////////////////////////////////////////////////////////
24 
25 #include "TConditionImp.h"
26 
27 #ifndef __CINT__
28 #include <pthread.h>
29 #else
30 struct pthread_cond_t;
31 #endif
32 
33 class TMutexImp;
34 class TPosixMutex;
35 
36 
37 class TPosixCondition : public TConditionImp {
38 
39 private:
40  pthread_cond_t fCond; // the pthread condition variable
41  TPosixMutex *fMutex; // mutex used around Wait() and TimedWait()
42 
43 public:
44  TPosixCondition(TMutexImp *m);
45  virtual ~TPosixCondition();
46 
47  Int_t Wait();
48  Int_t TimedWait(ULong_t secs, ULong_t nanoSecs = 0);
49  Int_t Signal();
50  Int_t Broadcast();
51 
52  ClassDef(TPosixCondition,0) // Posix condition variable
53 };
54 
55 #endif