| PTHREAD_ATTR_GETDETACHSTATE(3) | Library Functions Manual | PTHREAD_ATTR_GETDETACHSTATE(3) |
pthread_attr_getdetachstate,
pthread_attr_setdetachstate —
get and set the “detach state”
attribute
POSIX Threads Library (libpthread, -lpthread)
#include
<pthread.h>
int
pthread_attr_getdetachstate(const
pthread_attr_t *attr, int
*detachstate);
int
pthread_attr_setdetachstate(pthread_attr_t
*attr, int
detachstate);
The attribute parameters for the
pthread_attr_getdetachstate()
and
pthread_attr_setdetachstate()
functions are mutually exclusive and must be one of:
PTHREAD_CREATE_JOINABLEPTHREAD_CREATE_DETACHEDIf the thread is created as detached, it is an error to use the thread ID with pthread_detach(3) or pthread_join(3).
If successful, these functions return 0. Otherwise, an error number is returned to indicate the error.
No errors are defined for
pthread_attr_getdetachstate().
The pthread_attr_setdetachstate() function
should fail if:
EINVAL]Both functions conform to IEEE Std 1003.1-2001 (“POSIX.1”).
| July 9, 2010 | NetBSD 11.0 |