Semaphore synchronization class. More...
#include <semaphore.h>
Inherits dbp::semaphore_int.
Public Member Functions | |
| semaphore () | |
| Constructor. | |
| virtual | ~semaphore () |
| Destructor. | |
| virtual void | lock () |
| Lock the semaphore. | |
| virtual void | unlock () |
| Unlock the semaphore. | |
Semaphore synchronization class.
This class represents the thread syncronization object, semaphore. It is frequently used in the multithreaded producer-consumer algorithms.
| virtual void dbp::semaphore::lock | ( | ) | [virtual] |
Lock the semaphore.
lock() decrements the internal lock counter. If the lock counter is greater than zero, then the decrement proceeds, and the function returns immediately. If the lock counter is zero, then the call blocks calling thread until the lock counter rises above zero.
| virtual void dbp::semaphore::unlock | ( | ) | [virtual] |