34 #ifndef PTLIB_SYNCTHRD_H 35 #define PTLIB_SYNCTHRD_H 112 virtual void WaitCondition();
129 virtual void OnWait();
174 void PrintOn(ostream & strm)
const;
189 operator int()
const {
return value; }
317 Nest() { readerCount = writerCount = 0; }
318 unsigned readerCount;
319 unsigned writerCount;
321 typedef std::map<PThreadIdentifier, Nest>
NestMap;
328 void InternalStartRead();
329 void InternalEndRead();
330 void InternalWait(
PSemaphore & semaphore)
const;
410 #endif // PTLIB_SYNCTHRD_H This class defines a thread synchronisation object.
Definition: semaphor.h:78
This class defines an arbitrary time interval to millisecond accuracy.
Definition: timeint.h:55
This is a PCondMutex for which the conditional is the value of an integer.
Definition: syncthrd.h:138
#define PCLASSINFO(cls, par)
Declare all the standard PTLib class information.
Definition: object.h:1049
std::map< PThreadIdentifier, Nest > NestMap
Definition: syncthrd.h:321
PSemaphore writerSemaphore
Definition: syncthrd.h:310
virtual void Signal()
If there are waiting (blocked) threads then unblock the first one that was blocked.
Definition: syncthrd.h:314
PSyncPoint syncPoint
Definition: syncthrd.h:132
int value
Definition: syncthrd.h:239
virtual void PrintOn(ostream &strm) const
Output the contents of the object to the stream.
NestMap m_nestedThreads
Definition: syncthrd.h:322
BOOL PBoolean
Definition: object.h:102
This class defines a thread synchronisation object.
Definition: syncthrd.h:103
Operation
defines possible operators on current value and target value
Definition: syncthrd.h:146
unsigned readerCount
Definition: syncthrd.h:307
PReadWriteMutex & mutex
Definition: syncthrd.h:368
PReadWriteMutex & mutex
Definition: syncthrd.h:406
PSyncPoint ack
Definition: syncthrd.h:94
This class starts a read operation for the PReadWriteMutex on construction and automatically ends the...
Definition: syncthrd.h:351
Operation operation
Definition: syncthrd.h:240
unsigned writerCount
Definition: syncthrd.h:312
PMutex m_nestingMutex
Definition: syncthrd.h:323
Less than or equal to.
Definition: syncthrd.h:150
Equal to.
Definition: syncthrd.h:152
Greater than or equal to.
Definition: syncthrd.h:154
This class starts a write operation for the PReadWriteMutex on construction and automatically ends th...
Definition: syncthrd.h:389
PMutex readerMutex
Definition: syncthrd.h:306
This class defines a thread synchronisation object.
Definition: syncthrd.h:251
Less than.
Definition: syncthrd.h:148
void Acknowledge()
This indicates that the thread that was blocked in a Wait() on this synchronisation object has comple...
PMutex writerMutex
Definition: syncthrd.h:311
This class defines a thread synchronisation object.
Definition: syncthrd.h:67
Ultimate parent class for all objects in the class library.
Definition: object.h:1118
PSemaphore readerSemaphore
Definition: syncthrd.h:305
This class defines a thread synchronisation object.
Definition: syncpoint.h:67
PMutex starvationPreventer
Definition: syncthrd.h:308