Index of Section 2 Manual Pages
| Interix / SUA | pthread_attr_setdetachstate.2 | Interix / SUA |
pthread_attr_setdetachstate(2) pthread_attr_setdetachstate(2)
pthread_attr_getdetachstate()
NAME
pthread_attr_getdetachstate(), pthread_attr_setdetachstate() - get or set
the thread detach-state attribute
SYNOPSIS
#include
int pthread_attr_getdetachstate(const pthread_attr_t *attr, int
*detachstate)
int pthread_attr_setdetachstate(pthread_attr_t *attr, int detachstate);
DESCRIPTION
The pthread_attr_setdetachstate(2) function sets the detach-state
attribute in the thread attributes object referenced by attr using the
value of the detachstate argument. If detachstate is set to
PTHREAD_CREATE_DETACHED, then any thread created using the attr thread
attributes object is created in a detached state. If detachstate is set to
PTHREAD_CREATE_JOINABLE (the default), then the thread is created in a
joinable state.
After the attributes have been set in the thread attributes object
referenced by attr, the pthread_create(2) function can be called to create
a new thread with the specified attributes. This function does not affect
the current running thread.
The pthread_attr_getdetachstate(2) function retrieves the detach-state
attribute in the attr thread attributes object, storing the value in the
location referenced by the detachstate argument.
RETURN VALUES
On success, both functions return 0; otherwise, they return an error
number.
ERRORS
The pthread_attr_setdetachstate() function can fail for the following
reason:
[EINVAL]
The value of the detachstate argument was invalid.
Neither function returns [EINTR].
SEE ALSO
pthread_attr_destroy(2)
pthread_attr_getstackaddr(2)
pthread_attr_getstacksize(2)
pthread_create(2)
USAGE NOTES
All of these functions are thread safe.
None of these functions are async-signal safe.