library: libThread #include "TCondition.h"

# TCondition

class description - source file - inheritance tree (.ps)

## class TCondition : public TObject

| Inheritance Chart:

`TObject`

<-

`TCondition`

        public:

                          TCondition(TMutex* m = 0)
                          TCondition(const TCondition&)
                  virtual ~TCondition()
                    Int_t Broadcast()
           static TClass* Class()
                  TMutex* GetMutex() const
          virtual TClass* IsA() const
              TCondition& operator=(const TCondition&)
             virtual void ShowMembers(TMemberInspector& insp, char* parent)
                    Int_t Signal()
             virtual void Streamer(TBuffer& b)
                     void StreamerNVirtual(TBuffer& b)
                    Int_t TimedWait(ULong_t secs, ULong_t nanoSecs = 0)
                    Int_t Wait()

### Data Members

        private:

          TConditionImp* fConditionImp  pointer to condition variable implementation
                 TMutex* fMutex         mutex used around Wait() and TimedWait()

## Class Description

     TCondition

     This class implements a condition variable. Use a condition variable
     to signal threads. The actual work is done via the TConditionImp
     class (either TPosixCondition, TSolarisCondition or TNTCondition).

TCondition(TMutex *m)

     Create a condition variable. The actual condition implementation
     will be provided via the TThreadFactory. If no external mutex is
     provided one will be created. Use GetMutex() to get this mutex
     and use it before calling Signal() or Broadcast().

~TCondition()

     Clean up condition variable.

TMutex* GetMutex() const

     Get internally created mutex. Use it to lock resources
     before calling Signal() or Broadcast(). Returns 0 if
     external mutex was provided in TCondition ctor.

Int_t Wait()

     Wait for to be signaled.

Int_t TimedWait(ULong_t secs, ULong_t nanoSec)

     Wait not more than secs+nanoSecs to be signaled.

### Inline Functions

                  Int_t Signal()
                  Int_t Broadcast()
                TClass* Class()
                TClass* IsA() const
                   void ShowMembers(TMemberInspector& insp, char* parent)
                   void Streamer(TBuffer& b)
                   void StreamerNVirtual(TBuffer& b)
             TCondition TCondition(const TCondition&)
            TCondition& operator=(const TCondition&)

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