int pthread_condattr_init(pthread_condattr_t
*attr);
int pthread_condattr_setpshared(pthread_condattr_t *attr, int process-shared);
int pthread_condattr_getpshared (const pthread_condattr_t *attr, int *process-shared);
int pthread_condattr_destroy(pthread_condattr_t *attr);
At present, the only attribute available is the scope of condition variables, specified by process-shared.
The default value of the process-shared attribute is PTHREAD_PROCESS_PRIVATE , which only allows the condition variable to be operated upon by threads created within the same process as the thread that initialized the condition variable. If threads from other processes try to operate on this condition variable, the behavior is undefined.
The process-shared attribute may be set to PTHREAD_PROCESS_SHARED which allows a condition variable to be operated upon by any thread with access to the memory allocated to the condition variable, even if the condition variable is allocated in memory that is shared by multiple processes.
Attempts to initialize previously initialized condition variable attributes object will leave the storage allocated by the previous initialization unallocated.
Once a condition variable attributes object initializes one or more condition variables, any function affecting the attributes object (including destruction) will not effect any previously initialized condition variables.
pthread_condattr_init(), pthread_condattr_destroy(), and pthread_condattr_setpshared() return 0 upon a successful return; otherwise, an error number is returned.
pthread_condattr_getpshared() returns 0 upon a successful return, and stores the value of the process-shared attribute of attr in the object referenced by the process-shared parameter; otherwise, an error number is returned.
pthread_condattr_destroy(), pthread_condattr_getpshared(), and pthread_condattr_setpshared() return an error number if the following condition is detected:
pthread_condattr_setpshared() returns an error number if the following condition is detected: