pthread_sleepon_lock()

Updated: April 19, 2023

Lock the pthread_sleepon* functions

Synopsis:

#include <pthread.h>

int pthread_sleepon_lock( void );

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The pthread_sleepon_lock() function calls pthread_mutex_lock() on a mutex associated with the pthread_sleepon* class of functions. You should call this function before testing conditions that determine whether you need to call pthread_sleepon_wait(), pthread_sleepon_signal(), or pthread_sleepon_broadcast(). This mutex prevents other threads from changing the conditions between the time you examine and act upon them.

This function may be implemented as a simple macro.

Returns:

EOK
Success.
EDEADLK
The calling thread already owns the controlling mutex.

Classification:

QNX Neutrino

Safety:  
Cancellation point Yes
Interrupt handler No
Signal handler Yes
Thread Yes