This class waits for the semaphore on construction and automatically signals the semaphore on destruction.
![]() | PWaitAndSignal ( PSemaphore & sem, BOOL wait = TRUE ) Create the semaphore wait instance. |
![]() | ~PWaitAndSignal () Signal the semaphore. |
This class waits for the semaphore on construction and automatically signals the semaphore on destruction. Any descendent of PSemaphore may be used.This is very usefull for constructs such as:
void func() { PWaitAndSignal mutexWait(myMutex); if (condition) return; do_something(); if (other_condition) return; do_something_else(); }
~PWaitAndSignal()
Alphabetic index HTML hierarchy of classes or Java