OSF DCE Application Development Guide--Core Components

OSF DCE Application Development Guide—Core Components
7.3 Attributes Objects
An attributes object is used to describe the behavior of threads, mutexes, and condition
variables. This description consists of the individual attribute values that are used to
create an attributes object. Whether an attribute is valid depends on whether it describes
threads, mutexes, or condition variables.
When you create an object, you can accept the default attributes for that object, or you
can specify an attributes object that contains individual attributes that you have set. For
a thread, you can also change one or more attributes after thread execution starts; for
example, calling the pthread_setprio( ) routine to change the priority that you specified
with the pthread_attr_setprio() routine.
The following subsections describe how to create and delete attributes objects and
describe the individual attributes that you can specify for different objects.
7.3.1 Creating an Attributes Object
To create an attributes object, use one of the following routines, depending on the type of
object to which the attributes apply:
The pthread_attr_create( ) routine for thread attributes objects
The pthread_condattr_create() routine for condition variable attributes objects
The pthread_mutexattr_create() routine for mutex attributes objects
These routines create an attributes object containing default values for the individual
attributes. To modify any attribute values in an attributes object, use one of the set
routines described in the following subsections.
Creating an attributes object or changing the values in an attributes object does not affect
the attributes of objects previously created.
7.3.2 Deleting an Attributes Object
To delete an attributes object, use one of the following routines:
The pthread_attr_delete() routine for thread attributes objects
The pthread_condattr_delete( ) routine for condition variable attributes objects
The pthread_mutexattr_delete( ) routine for mutex attributes objects
Deleting an attributes object does not affect the attributes of objects previously created.
7 4 Tandem Computers Incorporated 124245