pthread_cond_signal

Signals on the condition variable.

Library:LibC
Classification:POSIX
Service:Synchronization

Syntax

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

Parameters

cond

(IN) Points to the condition variable to signal.

Return Values

If successful, returns zero; otherwise, returns a nonzero error code:

Decimal

Constant

Description

5

ENOMEM

Insufficient memory to complete the call.

9

EINVAL

The cond parameter is invalid.

Remarks

The pthread_cond_signal function wakes up one of the threads blocked on the condition variable. If more than one thread is blocked on the condition variable, no assumptions can be made on which of those threads might be awakened. The pthread_cond_signal function has no effect on threads that are not awakened.

NOTE:Condition variables are stateless. If no threads are blocked on the condition variable, the call to pthread_cond_signal has no effect and is not remembered. A subsequent call to pthread_cond_wait or pthread_cond_timedwait blocks the calling thread.

See Also