Initializes and destroys condition variable.
Threads Library (libpthreads.a)
#include <pthread.h> int pthread_condattr_destroy (attr) pthread_condattr_t *attr; int pthread_condattr_init (attr) pthread_condattr_t *attr;
The function pthread_condattr_init initializes a condition variable attributes object attr with the default value for all of the attributes defined by the implementation. Attempting to initialize an already initialized condition variable attributes object results in undefined behavior.
After a condition variable attributes object has been used to initialize one or more condition variables, any function affecting the attributes object (including destruction) does not affect any previously initialized condition variables.
The pthread_condattr_destroy function destroys a condition variable attributes object; the object becomes, in effect, uninitialized. The pthread_condattr_destroy subroutine may set the object referenced by attr to an invalid value. A destroyed condition variable attributes object can be re-initialized using pthread_condattr_init; the results of otherwise referencing the object after it has been destroyed are undefined.
attr | Specifies the condition attributes object to delete. |
If successful, the pthread_condattr_init and pthread_condattr_destroy functions return zero. Otherwise, an error number is returned to indicate the error.
The pthread_condattr_init function will fail if:
ENOMEM | Insufficient memory exists to initialize the condition variable attributes object. |
The pthread_condattr_destroy function may fail if:
EINVAL | The value specified by attr is invalid. |
These functions will not return an error code of EINTR.
The pthread_cond_init (pthread_cond_destroy or pthread_cond_init Subroutine) subroutine, pthread_condattr_getpshared (pthread_condattr_getpshared Subroutine) subroutine, pthread_create (pthread_create Subroutine) subroutine, pthread_mutex_init (pthread_mutex_init or pthread_mutex_destroy Subroutine) subroutine.
The pthread.h file.
Using Condition Variables in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.
Threads Library Quick Reference in AIX 5L Version 5.2 General Programming Concepts: Writing and Debugging Programs.