30 #ifndef PTLIB_SEMAPHORE_H
31 #define PTLIB_SEMAPHORE_H
87 unsigned maximum = UINT_MAX
88 ) {
Reset(initial, maximum); }
97 unsigned maximum = UINT_MAX
141 unsigned initial = 0,
142 unsigned maximum = UINT_MAX
163 #include "msos/ptlib/semaphor.h"
165 #include "unix/ptlib/semaphor.h"
170 #endif // PTLIB_SEMAPHORE_H
This class defines a thread synchronisation object.
Definition: semaphor.h:74
This class defines an arbitrary time interval to millisecond accuracy.
Definition: timeint.h:51
unsigned m_initial
Definition: semaphor.h:158
virtual void Signal()
If there are waiting (blocked) threads then unblock the first one that was blocked.
virtual void Wait()
If the semaphore count is > 0, decrement the semaphore and return.
~PSemaphore()
Destroy the semaphore.
unsigned GetMaximum() const
Get the initial value semaphore was creted with.
Definition: semaphor.h:151
PString m_name
Definition: semaphor.h:156
bool PBoolean
Definition: object.h:174
PSemaphore(unsigned initial=0, unsigned maximum=UINT_MAX)
Create a new semaphore with maximum count and initial value specified.
Definition: semaphor.h:85
The character string class.
Definition: pstring.h:108
virtual void Reset(unsigned initial=0, unsigned maximum=UINT_MAX)
Reset the semaphore to the specified inital and maximum values.
unsigned GetInitial() const
Get the initial value semaphore was creted with.
Definition: semaphor.h:147
unsigned m_maximum
Definition: semaphor.h:157
PSemaphore(const PSemaphore &sem)
Create a new semaphore with the same initial and maximum values as the original.
Definition: semaphor.h:102
PSemaphore(const PString &name, unsigned initial=0, unsigned maximum=UINT_MAX)
Create a new system global semaphore with maximum count and initial value specified.
Definition: semaphor.h:94