[Previous] [Contents] [Next]

pthread_sleepon_lock()

Lock the pthread_sleepon*() functions

Synopsis:

#include <pthread.h>

int pthread_sleepon_lock( void );

Library:

libc

Description:

The pthread_sleepon_lock() function calls pthread_mutex_lock() on a mutex associated with the pthread_sleepon*() class of functions. It should be called before testing conditions which 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
Calling thread already owns the controlling mutex.
EAGAIN
On the first use of pthread_sleepon_lock(), all kernel mutex objects were in use.

Classification:

QNX 6

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

See also:

pthread_mutex_lock(), pthread_sleepon_broadcast(), pthread_sleepon_signal(), pthread_sleepon_unlock(), pthread_sleepon_wait()


[Previous] [Contents] [Next]