[Previous] [Contents] [Next]

pthread_attr_setdetachstate()

Set thread detach state attribute

Synopsis:

#include <pthread.h>

int pthread_attr_setdetachstate(
                 pthread_attr_t* attr,
                 int detachstate );

Library:

libc

Description:

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.

Returns:

EOK
Success.
EINVAL
Invalid thread detach state value.

Classification:

POSIX 1003.1 (Threads)

Safety:
Cancellation point No
Interrupt handler No
Signal handler Yes
Thread Yes

See also:

pthread_attr_getdetachstate(), pthread_attr_init(), pthread_create(), pthread_detach(), pthread_join().


[Previous] [Contents] [Next]