pthread_cond_signal(PTHREAD)
pthread_cond_signal, pthread_cond_broadcast --
wake up threads waiting on a condition variable
Synopsis
cc [options] -Kthread file
#include <pthread.h>
int pthread_cond_signal(pthread_cond_t *cond);
int pthread_cond_broadcast(pthread_cond_t *cond);
Description
pthread_cond_signal wakes up a single thread,
if one exists, waiting on the condition cond.
pthread_cond_broadcast wakes up all threads
waiting on the condition cond.
If more than one thread is waiting,
the choice of which to release from the blocked group
is scheduling policy-specific:
Bound threads have priority over multiplexed threads; then
within each category the choice of thread is scheduling-policy-specific.
pthread_cond_signal and pthread_cond_broadcast
have no effect
if there are no threads waiting on cond.
A pthread_cond_signal or pthread_cond_broadcast
will be more reliable if the associated mutex
used by waiters is held across the call.
The condition variable denoted by cond
must previously have been initialized (see
pthread_cond_init(PTHREAD)).
See the description of how to use condition variables
on
Intro(PTHREAD).
Return values
pthread_cond_signal aand pthread_cond_broadcast
return zero for success
and an error number for failure.
Diagnostics
If the following condition is detected,
pthread_cond_signal or pthread_cond_broadcast
return the corresponding value:
EINVAL-
invalid argument specified
References
Intro(PTHREAD)
pthread_cond_init(PTHREAD),
pthread_cond_timedwait(PTHREAD),
pthread(F)
Standards compliance
The Single UNIX Specification, Version 2; The Open Group.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005