Logo ROOT   6.08/07
Reference Guide
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 #ifndef ROOT_TConditionImp
26 #include "TConditionImp.h"
27 #endif
28 
29 #ifndef __CINT__
30 #include <pthread.h>
31 #else
32 struct pthread_cond_t;
33 #endif
34 
35 class TMutexImp;
36 class TPosixMutex;
37 
38 
40 
41 private:
42  pthread_cond_t fCond; // the pthread condition variable
43  TPosixMutex *fMutex; // mutex used around Wait() and TimedWait()
44 
45 public:
47  virtual ~TPosixCondition();
48 
49  Int_t Wait();
50  Int_t TimedWait(ULong_t secs, ULong_t nanoSecs = 0);
51  Int_t Signal();
52  Int_t Broadcast();
53 
54  ClassDef(TPosixCondition,0) // Posix condition variable
55 };
56 
57 #endif
TPosixCondition(TMutexImp *m)
Create Condition variable.
int Int_t
Definition: RtypesCore.h:41
virtual ~TPosixCondition()
TCondition dtor.
#define ClassDef(name, id)
Definition: Rtypes.h:254
Int_t Signal()
If one or more threads have called Wait(), Signal() wakes up at least one of them, possibly more.
TMarker * m
Definition: textangle.C:8
Int_t Wait()
Wait for the condition variable to be signalled.
pthread_cond_t fCond
TPosixMutex * fMutex
unsigned long ULong_t
Definition: RtypesCore.h:51
Int_t Broadcast()
Broadcast is like signal but wakes all threads which have called Wait().
Int_t TimedWait(ULong_t secs, ULong_t nanoSecs=0)
TimedWait() is given an absolute time to wait until.