Hardware Reference
In-Depth Information
cond : A pointer to the condition variable used to signal one
thread
returns : Returns zero if the function call was successful;
otherwise, an error number is returned (not in errno ).
Error
Description
EINVAL
The value cond does not refer to an initialized condition variable.
It is not an error if no other thread is waiting. This function does, however, wake up
one waiting thread, if one or more are waiting on the specified condition variable.
This call is preferred for performance reasons if signaling one thread will “work.”
When there are special conditions whereby some threads may succeed and others would
not, you need a broadcast call instead. When it can be used, waking one thread saves
CPU cycles.
pthread_cond_broadcast(3)
This is the broadcast variant of pthread_cond_signal(3) . If multiple waiters have
different tests, a broadcast should be used to allow all waiters to wake up and consider
the conditions found.
int pthread_cond_broadcast(pthread_cond_t
cond);
cond : A pointer to the condition variable to be signaled , waking
all waiting threads.
returns : Zero is returned when the call is successful;
otherwise, an error number is returned (not in errno ).
Error
Description
EINVAL
The value cond does not refer to an initialized condition variable.
It is not an error to broadcast when there are no waiters.
 
 
Search WWH ::




Custom Search