library: libThread #include "TSemaphore.h" |
TSemaphore
class description - header file - source file - inheritance tree (.pdf)
public:
TSemaphore(UInt_t initial = 1)
TSemaphore(const TSemaphore& s)
virtual ~TSemaphore()
static TClass* Class()
virtual TClass* IsA() const
TSemaphore& operator=(const TSemaphore& s)
Int_t Post()
virtual void ShowMembers(TMemberInspector& insp, char* parent)
virtual void Streamer(TBuffer& b)
void StreamerNVirtual(TBuffer& b)
Int_t TryWait()
Int_t Wait(Int_t millisec = 0)
private:
TMutex fMutex semaphare mutex
TCondition fCond semaphore condition variable
Int_t fValue counter
TSemaphore
This class implements a counting semaphore. Use a semaphore
to synchronize threads.
Int_t Wait(Int_t millisec)
If semaphore value is > 0 then decrement it and carry on. If it's
already 0 then block. If millisec > 0, apply a relative timeout
of millisec milliseconds.
Int_t TryWait()
If semaphore value is > 0 then decrement it and return 0. If it's
already 0 then return 1.
Int_t Post()
If any threads are blocked in Wait(), wake one of them up. Otherwise
increment the value of the semaphore.
Author: Fons Rademakers 02/07/97
Last update: root/thread:$Name: $:$Id: TSemaphore.cxx,v 1.5 2006/06/01 16:28:18 rdm Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
ROOT page - Class index - Class Hierarchy - Top of the page
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.