![]() |
![]() |
![]() |
Initialize thread attribute object
#include <pthread.h> int pthread_attr_init( pthread_attr_t *attr );
libc
The pthread_attr_init() function initializes the thread attributes in the thread attribute object attr to their default values. After initialization, any attributes which need to be changed from their default value can be set using the pthread_attr_set() family of functions. The attribute object can then be passed to the pthread_create() function to create a thread with the required attributes. A single attribute object can be used in multiple calls to pthread_create().
The thread attributes and their default values are:
Attribute | Default Value |
---|---|
detachstate | PTHREAD_CREATE_JOINABLE |
schedpolicy | PTHREAD_INHERIT_SCHED |
schedparam | Inherited from parent thread |
contentionscope | PTHREAD_SCOPE_SYSTEM |
stacksize | 4K bytes |
stackaddr | NULL |
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |
pthread_attr_destroy(), pthread_create().
![]() |
![]() |
![]() |