#include </home/sspr/src/www/orocos-1.0/export/build/orocos-rtt-1.2.2/build/rtt/os/Semaphore.hpp>
It works like a traffic light on which a thread can wait() until the sempahore's value becomes positive, otherwise it blocks. Another thread then needs to signal() the semaphore. One thread which is waiting will then be awakened, if none is waiting, the first thread calling wait() will continue directly (and decrease the value by 1).
Public Member Functions | |
| Semaphore (int count) | |
| Initialize a Semaphore with an initial count. | |
| ~Semaphore () | |
| Destroy a Semaphore. | |
| void | wait () |
| void | signal () |
| bool | trywait () |
| Try to wait on this semaphore. | |
| int | value () |
| bool trywait | ( | ) | [inline] |
Try to wait on this semaphore.
1.5.1