pthread_cond_broadcast(3) - NetBSD Manual Pages

PTHREAD_COND_BROADCA... NetBSD Library Functions ManualPTHREAD_COND_BROADCA...


NAME
pthread_cond_broadcast, pthread_cond_signal -- unblock one or all threads waiting on a condition variable
LIBRARY
POSIX Threads Library (libpthread, -lpthread)
SYNOPSIS
#include <pthread.h> int pthread_cond_broadcast(pthread_cond_t *cond); int pthread_cond_signal(pthread_cond_t *cond);
DESCRIPTION
The pthread_cond_broadcast() function unblocks all threads waiting for the condition variable cond. If no threads are waiting on cond, the pthread_cond_broadcast() function has no effect. The pthread_cond_signal() function unblocks one thread waiting for the condition variable cond. If no threads are waiting on cond, the pthread_cond_signal() function has no effect. When calling pthread_cond_wait() and/or pthread_cond_timedwait(), a tem- porary binding is established between the condition variable cond and a caller-supplied mutex. The same mutex must be held while calling pthread_cond_broadcast() and pthread_cond_signal(). Neither function enforces this requirement, but if the mutex is not held the resulting behaviour is undefined.
RETURN VALUES
If successful, the pthread_cond_broadcast() and pthread_cond_signal() functions will return zero, otherwise an error number will be returned to indicate the error.
ERRORS
pthread_cond_broadcast() and pthread_cond_signal() may fail if: [EINVAL] The value specified by cond is invalid.
SEE ALSO
pthread_cond_destroy(3), pthread_cond_init(3), pthread_cond_timedwait(3), pthread_cond_wait(3)
STANDARDS
pthread_cond_broadcast() and pthread_cond_signal() conform to ISO/IEC 9945-1:1996 (``POSIX.1''). NetBSD 5.2.2 May 26, 2008 NetBSD 5.2.2

Powered by man-cgi (2024-08-26). Maintained for NetBSD by Kimmo Suominen. Based on man-cgi by Panagiotis Christias.