library: libThread #include "TPosixCondition.h"

# TPosixCondition

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

## class TPosixCondition : public TConditionImp

| Inheritance Chart:
`TObject`
| <- | `TConditionImp`
| <- | `TPosixCondition` |

        public:

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

### Data Members

        private:

          pthread_cond_t fCond   the pthread condition variable
            TPosixMutex* fMutex  mutex used around Wait() and TimedWait()

## Class Description

     TPosixCondition

     This class provides an interface to the posix condition variable
     routines.

TPosixCondition(TMutexImp *m)

     Create Condition variable. Ctor must be given a pointer to an
     existing mutex. The condition variable is then linked to the mutex,
     so that there is an implicit unlock and lock around Wait() and
     TimedWait().

~TPosixCondition()

     TCondition dtor.

Int_t Wait()

     Wait for the condition variable to be signalled. The mutex is
     implicitely released before waiting and locked again after waking up.
     If Wait() is called by multiple threads, a signal may wake up more
     than one thread. See POSIX threads documentation for details.

Int_t TimedWait(ULong_t secs, ULong_t nanoSecs)

     TimedWait() is given an absolute time to wait until. To wait for a
     relative time from now, use TThread::GetTime(). See POSIX threads
     documentation for why absolute times are better than relative.
     Returns 0 if successfully signalled, 1 if time expired.

Int_t Signal()

     If one or more threads have called Wait(), Signal() wakes up at least
     one of them, possibly more. See POSIX threads documentation for details.

Int_t Broadcast()

     Broadcast is like signal but wakes all threads which have called Wait().

### Inline Functions

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

Author: Fons Rademakers 01/07/97
Last update: root/thread:$Name: $:$Id: TPosixCondition.cxx,v 1.3 2004/12/08 14:02:41 rdm Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *