Wait on a sleepon lock
#include <pthread.h> int _sleepon_wait( sleepon_t * l, const volatile void * addr, uint64_t nsec);
- A pointer to a sleepon_t that you created by calling _sleepon_init() .
- The handle that you want to wait on. The value of addr is typically a data structure that controls a resource.
- Zero, or the amount of time, in nanoseconds, to wait before the thread wakes up. If this timeout occurs, ETIMEDOUT is returned.
Use the -l c option to qcc to link against this library. This library is usually included automatically.
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() .
- Failure; a nonzero errno value.