Creates a thread attributes object and initializes it with default values.
Threads Library (libpthreads.a)
#include <pthread.h>
int pthread_attr_init (attr) pthread_attr_t *attr;
The pthread_attr_init subroutine creates a new thread attributes object attr. The new thread attributes object is initialized with the following default values:
Always initialized | |
Attribute | Default value |
Detachstate | PTHREAD_CREATE_JOINABLE |
Always Initialized | |
Attribute | Default value |
Contention-scope | PTHREAD_SCOPE_PROCESS the default ensures compatibility with implementations that do not support this POSIX option. |
Inheritsched | PTHREAD_INHERITSCHED |
Schedparam | A sched_param structure which sched_prio field is set to 1, the least favored priority. |
Schedpolicy | SCHED_OTHER |
Always Initialized | |
Attribute | Default value |
Stacksize | PTHREAD_STACK_MIN |
Guardsize | PAGESIZE |
The resulting attribute object (possibly modified by setting individual attribute values), when used by pthread_create, defines the attributes of the thread created. A single attributes object can be used in multiple simultaneous calls to pthread_create.
attr | Specifies the thread attributes object to be created. |
Upon successful completion, the new thread attributes object is filled with default values and returned via the attr parameter, and 0 is returned. Otherwise, an error code is returned.
The pthread_attr_init subroutine is unsuccessful if the following is true:
EINVAL | The attr parameter is not valid. |
ENOMEM | There is not sufficient memory to create the thread attribute object. |
This function will not return an error code of [EINTR].
This subroutine is part of the Base Operating System (BOS) Runtime.
The pthread_attr_setdetachstate subroutine, pthread_attr_setstackaddr subroutine, pthread_attr_setstacksize subroutine, pthread_create subroutine, pthread_attr_destroy and pthread_attr_setguardsize subroutine.
The pthread.h file.
Creating Threads in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.
Threads Library Options and Threads Library Quick Reference in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.