DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

pthread_condattr_init(PTHREAD)


pthread_condattr_init, pthread_condattr_destroy -- initialise and destroy condition variable attributes object

Synopsis

cc [options] -Kthread file

#include <pthread.h>

int pthread_condattr_init(pthread_condattr_t *attr); int pthread_condattr_destroy(pthread_condattr_t *attr);

Description

pthread_condattr_init initialises a condition variable attributes object attr with the default values for all of the attributes defined by the implementation.

Attempting to initialize an already initialised condition variable attributes object results in undefined behaviour.

After a condition variable attributes object has been used to initialise one or more condition variables, any function affecting the attributes object (including destruction) does not affect any previously initialised condition variables.

pthread_condattr_destroy destroys a condition variable attributes object; the object becomes, in effect, uninitialised. A destroyed condition variable attributes object can be re-initialised using pthread_condattr_init. The results of otherwise referencing the object after it has been destroyed are undefined.

Return values

If successful, the pthread_condattr_init and pthread_condattr_destroy functions return zero. Otherwise, an error number is returned to indicate the error.

Diagnostics

If the following condition is detected, pthread_condattr_init returns the corresponding value:

ENOMEM
insufficient memory to initialise the condition variable attributes object.

If the following condition is detected, pthread_condattr_destroy will return the corresponding value:


EINVAL
attr is invalid.

References

pthread_condattr_getpshared(PTHREAD), pthread_create(PTHREAD), pthread_cond_init(PTHREAD), pthread(F)

Standards compliance

The Single UNIX Specification, Version 2; The Open Group.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005