A class for thread synchronization and mutual exclusion.
A semaphore has an internal counter. Multiple threads can safely increment or decrement that counter. If one thread attempts to decrement the counter below zero, it must wait for another thread to first increment it. This is a useful primitive for regulating thread interaction.
Definition at line 28 of file Semaphore.h.
Try to decrement the counter, even if we must wait - but don't wait forever.
This method wiill wait for at most timeoutInSeconds seconds (this can be fractional). If the counter has not been decremented within that interval, the method will return false.
|timeoutInSeconds||the maximum length of time to wait, in seconds (may be fractional). |
- true if the counter was decremented, false if a timeout occurred.
Definition at line 31 of file Semaphore.cpp.