TSemaphore


class description - source file - inheritance tree

class TSemaphore : public TObject


    public:
TSemaphore TSemaphore(UInt_t initial = 1) TSemaphore TSemaphore(TSemaphore&) virtual void ~TSemaphore() static TClass* Class() virtual TClass* IsA() const Int_t Post() virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) Int_t TryWait() Int_t Wait()

Data Members

private:
TMutex fMutex TCondition fCond Int_t fValue

Class Description

                                                                      
 TSemaphore                                                           
                                                                      
 This class implements a counting semaphore. Use a semaphore          
 to synchronize threads.                                              
                                                                      


TSemaphore(UInt_t initial) : fCond(&fMutex)
 Create counting semaphore.

Int_t Wait()
 If semaphore value is > 0 then decrement it and carry on. If it's
 already 0 then block.

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.



Inline Functions


            TClass* Class()
            TClass* IsA() const
               void ShowMembers(TMemberInspector& insp, char* parent)
               void Streamer(TBuffer& b)
         TSemaphore TSemaphore(TSemaphore&)
               void ~TSemaphore()


Author: Fons Rademakers 02/07/97
Last update: root/thread:$Name: $:$Id: TSemaphore.cxx,v 1.1.1.1 2000/05/16 17:00:48 rdm Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *


ROOT page - Class index - 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.