This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs. |
Wait on a sleepon lock
#include <pthread.h> int _sleepon_wait( sleepon_t * l, const volatile void * addr, _uint64 nsec);
libc
Use the -l c option to qcc to link against this library. This library is usually included automatically.
The _sleepon_wait() function blocks on the sleepon l using the key addr until woken up by either a _sleepon_signal() or a _sleepon_broadcast() call that uses the same addr key.
The calling thread must first have locked the sleepon by calling _sleepon_lock().
When the thread returns from this function, it must release the sleepon lock by calling _sleepon_unlock().
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | No |
Thread | Yes |
_sleepon_broadcast(), _sleepon_lock(), _sleepon_unlock(), _sleepon_signal()