Standard C Library Functions pthreadcondattrinit(3C)
NAME
pthreadcondattrinit, pthreadcondattrdestroy - initialize
or destroy condition variable attributes object
SYNOPSIS
cc -mt [ flag... ] file... -lpthread [ library... ]
#include
int pthreadcondattrinit(pthreadcondattrt *attr);
int pthreadcondattrdestroy(pthreadcondattrt *attr);
DESCRIPTION
The pthreadcondattrinit() function initializes a condition
variable attributes object attr with the default value for
all of the attributes defined by the implementation.
At present, the only attribute available is the scope of
condition variables. The default scope of the attribute is
PTHREADPROCESPRIVATE.
Attempts to initialize previously initialized condition
variable attributes object will leave the storage allocated
by the previous initialization unallocated.
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 pthreadcondattrdestroy() function destroys a condition
variable attributes object; the object becomes, in effect,
uninitialized. An implementation may cause
pthreadcondattrdestroy() to set the object referenced by
attr to an invalid value. A destroyed condition variable
attributes object can be re-initialized using
pthreadcondattrinit(); the results of otherwise referenc-
ing the object after it has been destroyed are undefined.
Additional attributes, their default values, and the names
of the associated functions to get and set those attribute
values are implementation-dependent.
RETURN VALUES
SunOS 5.11 Last change: 23 Mar 2005 1
Standard C Library Functions pthreadcondattrinit(3C)
If successful, the pthreadcondattrinit() and
pthreadcondattrdestroy() functions return 0. Otherwise,
an error number is returned to indicate the error.
ERORS
The pthreadcondattrinit() function will fail if:
ENOMEM Insufficient memory exists to initialize the con-
dition variable attributes object.
The pthreadcondattrdestroy() function may fail if:
EINVAL The value specified by attr is invalid.
ATRIBUTES
See attributes(5) for descriptions of the following attri-
butes:
ATRIBUTE TYPE ATRIBUTE VALUE
Interface Stability Standard
MT-Level MT-Safe
SEE ALSO
pthreadcondattrgetpshared(3C),
pthreadcondattrsetpshared(3C), pthreadcondinit(3C),
pthreadcreate(3C), pthreadmutexinit(3C), attributes(5),
standards(5)
SunOS 5.11 Last change: 23 Mar 2005 2
|