DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

cond_signal(SYNCH)


cond_signal -- wake up a single thread waiting on a condition variable

Synopsis

   cc [options] -Kthread file
   

#include <synch.h>

int cond_signal(cond_t *cond);

Description

cond_signal wakes up a single thread, if one exists, 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.

cond_signal has no effect if there are no threads waiting on cond.

A cond_signal will be more reliable if the associated mutex used by waiters is held across the call.

Parameters


cond
pointer to condition variable to be signaled

cond parameter

The condition variable denoted by cond must previously have been initialized (see cond_init(SYNCH)).

Usage

See the description of how to use condition variables under USAGE on condition(SYNCH).

Return values

cond_signal returns zero for success and an error number for failure.

Errors

If any of the following conditions is detected, cond_signal returns the corresponding value:

EINVAL
invalid argument specified

References

condition(SYNCH), cond_broadcast(SYNCH), cond_destroy(SYNCH), cond_init(SYNCH), cond_timedwait(SYNCH), cond_wait(SYNCH), Intro(SYNCH)
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005