12. Condition Variable Manager#
12.1. Introduction#
The condition variable manager …
The directives provided by the condition variable manager are:
pthread_condattr_init - Initialize a Condition Variable Attribute Set
pthread_condattr_destroy - Destroy a Condition Variable Attribute Set
pthread_condattr_setpshared - Set Process Shared Attribute
pthread_condattr_getpshared - Get Process Shared Attribute
pthread_cond_init - Initialize a Condition Variable
pthread_cond_destroy - Destroy a Condition Variable
pthread_cond_signal - Signal a Condition Variable
pthread_cond_broadcast - Broadcast a Condition Variable
pthread_cond_wait - Wait on a Condition Variable
pthread_cond_timedwait - With with Timeout a Condition Variable
12.2. Background#
There is currently no text in this section.
12.3. Operations#
There is currently no text in this section.
12.4. Directives#
This section details the condition variable manager’s directives. A subsection is dedicated to each of this manager’s directives and describes the calling sequence, related constants, usage, and status codes.
12.4.1. pthread_condattr_init - Initialize a Condition Variable Attribute Set#
CALLING SEQUENCE:
#include <pthread.h>
int pthread_condattr_init(
pthread_condattr_t *attr
);
STATUS CODES:
ENOMEM
Insufficient memory is available to initialize the condition variable attributes object.
DESCRIPTION:
NOTES:
12.4.2. pthread_condattr_destroy - Destroy a Condition Variable Attribute Set#
CALLING SEQUENCE:
#include <pthread.h>
int pthread_condattr_destroy(
pthread_condattr_t *attr
);
STATUS CODES:
|
The attribute object specified is invalid. |
DESCRIPTION:
NOTES:
12.4.5. pthread_cond_init - Initialize a Condition Variable#
CALLING SEQUENCE:
#include <pthread.h>
int pthread_cond_init(
pthread_cond_t *cond,
const pthread_condattr_t *attr
);
STATUS CODES:
|
The system lacked a resource other than memory necessary to create the initialize the condition variable object. |
|
Insufficient memory is available to initialize the condition variable object. |
|
The specified condition variable has already been initialized. |
|
The specified attribute value is invalid. |
DESCRIPTION:
NOTES:
12.4.6. pthread_cond_destroy - Destroy a Condition Variable#
CALLING SEQUENCE:
#include <pthread.h>
int pthread_cond_destroy(
pthread_cond_t *cond
);
STATUS CODES:
|
The specified condition variable is invalid. |
|
The specified condition variable is currently in use. |
DESCRIPTION:
NOTES:
12.4.7. pthread_cond_signal - Signal a Condition Variable#
CALLING SEQUENCE:
#include <pthread.h>
int pthread_cond_signal(
pthread_cond_t *cond
);
STATUS CODES:
|
The specified condition variable is not valid. |
DESCRIPTION:
NOTES:
This routine should not be invoked from a handler from an asynchronous signal handler or an interrupt service routine.
12.4.8. pthread_cond_broadcast - Broadcast a Condition Variable#
CALLING SEQUENCE:
#include <pthread.h>
int pthread_cond_broadcast(
pthread_cond_t *cond
);
STATUS CODES:
|
The specified condition variable is not valid. |
DESCRIPTION:
NOTES:
This routine should not be invoked from a handler from an asynchronous signal handler or an interrupt service routine.
12.4.9. pthread_cond_wait - Wait on a Condition Variable#
CALLING SEQUENCE:
#include <pthread.h>
int pthread_cond_wait(
pthread_cond_t *cond,
pthread_mutex_t *mutex
);
STATUS CODES:
|
The specified condition variable or mutex is not initialized OR different
mutexes were specified for concurrent |
DESCRIPTION:
NOTES:
12.4.10. pthread_cond_timedwait - Wait with Timeout a Condition Variable#
CALLING SEQUENCE:
#include <pthread.h>
int pthread_cond_timedwait(
pthread_cond_t *cond,
pthread_mutex_t *mutex,
const struct timespec *abstime
);
STATUS CODES:
|
The nanoseconds field of timeout is invalid. |
|
The specified condition variable or mutex is not initialized OR different
mutexes were specified for concurrent |
|
The specified time has elapsed without the condition variable being satisfied. |
DESCRIPTION:
NOTES: