pthread_cond_broadcast

Wakes up all the threads blocked on the condition variable.

Library:LibC
Classification:POSIX
Service:Synchronization

Syntax

  #include <pthread.h>
   
  int   pthread_cond_broadcast  (
     pthread_cond_t   *cond);
  

Parameters

cond

(IN) Points to the condition variable to signal.

Return Values

If successful, returns 0. Otherwise returns a nonzero error code.

Decimal

Constant

Description

9

EINVAL

The cond parameter is invalid.

Remarks

Condition variables are stateless. Calling pthread_cond_broadcast on a condition variable that does not have any waiting threads has no effect and is not remembered; a subsequent call to pthread_cond_wait or pthread_cond_timedwait will block the calling thread.

See Also