NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | RETURN VALUES | ATTRIBUTES | SEE ALSO
$(OS_DIR)/lib/libpthreads.a #include <pthread.h>int pthread_attr_init(pthread_attr_t * attr);
The function or functions documented here may not be used safely in all application contexts with all APIs provided in the ChorusOS 5.0 product.
See API(5FEA) for details.
The pthread_attr_init() function initializes the thread attribute object referenced by attr with the default values for all the individual thread attributes. The resulting attribute object may be modified by setting individual attribute values. When subsequently used by pthread_create() , it defines the attributes of the newly created thread. A single attribute object can be used in multiple simultaneous calls to pthread_create() . Modification of an attribute object has no effect on threads already created using that object.
The pthread_attr_destroy() function is used to delete a thread attribute object.
The complete list of thread creation attributes follows, with defaults indicated.
stacksize PTHREAD_STACK_MIN stackaddr stack dynamically allocated detachstate PTHREAD_CREATE_JOINABLE contentionscope PTHREAD_SCOPE_SYSTEM inheritsched PTHREAD_INHERIT_SCHED schedpolicy default schedpolicy schedparam default schedparam |
The latter four attributes, which pertain to scheduling, are described in pthread_attr_getscope(3POSIX) .
On successful completion, the calls return zero.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | API RESTRICTIONS | DESCRIPTION | RETURN VALUES | ATTRIBUTES | SEE ALSO