![]() |
![]() |
![]() |
Set thread detach state attribute
#include <pthread.h> int pthread_attr_setdetachstate( pthread_attr_t* attr, int detachstate );
libc
The pthread_attr_setdetachstate() function sets the thread detach state attribute in the thread attribute object attr to detachstate.
The thread detach state attribute may have the following values:
Constant | Meaning |
---|---|
PTHREAD_CREATE_JOINABLE | Thread is created in a joinable state. |
PTHREAD_CREATE_DETACHED | Thread is created in a detached state. |
The default value for the thread detach state is PTHREAD_CREATE_JOINABLE.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | Yes |
Thread | Yes |
pthread_attr_getdetachstate(), pthread_attr_init(), pthread_create(), pthread_detach(), pthread_join().
![]() |
![]() |
![]() |