Wait on a sleepon lock
#include <pthread.h> int _sleepon_wait( sleepon_t * l, const volatile void * addr, uint64_t 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 |