#include <semaphor.h>
Public Member Functions | |
PWaitAndSignal (const PSemaphore &sem, BOOL wait=TRUE) | |
~PWaitAndSignal () | |
Protected Attributes | |
PSemaphore & | semaphore |
This is very usefull for constructs such as: {verbatim} void func() { PWaitAndSignal mutexWait(myMutex); if (condition) return; do_something(); if (other_condition) return; do_something_else(); } {verbatim}
|
Create the semaphore wait instance. This will wait on the specified semaphore using the Wait()# function before returning.
|
|
Signal the semaphore. This will execute the Signal() function on the semaphore that was used in the construction of this instance. |
|
|