[Previous] [Contents] [Next]

SyncCondvarSignal(), SyncCondvarSignal_r()

Wake threads block on a synchronization object

Synopsis:

#include <sys/neutrino.h>

int SyncCondvarSignal( sync_t* sync,
                       int broadcast );

int SyncCondvarSignal_r( sync_t* sync,
                         int broadcast );

Library:

libc

Description:

The SyncCondvarSignal() and SyncCondvarSignal_r() functions are identical except in the way they indicate errors. See the Returns section for details.

These kernel calls wake up one or all threads blocked on the synchronization object sync.

If broadcast is zero, the thread with the highest priority which has been waiting the longest is made ready to run. Otherwise, all waiting threads are made ready.

In all cases, each awakened thread attempts to reacquire the controlling mutex passed in SyncCondvarWait() before control is returned to the thread. If the mutex is already locked when the kernel attempts to lock it, the thread becomes blocked on the mutex until it's unlocked.

The sync argument must have been initialized by a call to SyncTypeCreate() or statically initialized by the manifest PTHREAD_COND_INITIALIZER.

Blocking states

These calls don't block.

Returns:

The only difference between these functions is the way they indicate errors:

SyncCondvarSignal()
If an error occurs, -1 is returned and errno is set. Any other value returned indicates success.
SyncCondvarSignal_r()
EOK is returned on success. This function does NOT set errno. If an error occurs, any value in the Errors section may be returned.

Errors:

EFAULT
A fault occurred when the kernel tried to access sync.
EINVAL
The synchronization ID specified in sync doesn't exist.

Classification:

QNX 6

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

See also:

pthread_cond_broadcast(), pthread_cond_signal(), pthread_cond_wait(), SyncCondvarWait()


[Previous] [Contents] [Next]