1PTHREAD_ATTR_GETDETACHSTATE(P3OPS)IX Programmer's MaPnTuHaRlEAD_ATTR_GETDETACHSTATE(3P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10

NAME

12       pthread_attr_getdetachstate, pthread_attr_setdetachstate - get and  set
13       the detachstate attribute
14

SYNOPSIS

16       #include <pthread.h>
17
18       int pthread_attr_getdetachstate(const pthread_attr_t *attr,
19              int *detachstate);
20       int pthread_attr_setdetachstate(pthread_attr_t *attr, int detachstate);
21
22

DESCRIPTION

24       The  detachstate  attribute controls whether the thread is created in a
25       detached state. If the thread is created detached, then use of  the  ID
26       of  the  newly created thread by the pthread_detach() or pthread_join()
27       function is an error.
28
29       The  pthread_attr_getdetachstate()  and   pthread_attr_setdetachstate()
30       functions, respectively, shall get and set the detachstate attribute in
31       the attr object.
32
33       For pthread_attr_getdetachstate(), detachstate shall be set  to  either
34       PTHREAD_CREATE_DETACHED or PTHREAD_CREATE_JOINABLE.
35
36       For  pthread_attr_setdetachstate(),  the  application shall set detach‐
37       state to either PTHREAD_CREATE_DETACHED or PTHREAD_CREATE_JOINABLE.
38
39       A value of PTHREAD_CREATE_DETACHED shall cause all threads created with
40       attr to be in the detached state, whereas using a value of PTHREAD_CRE‐
41       ATE_JOINABLE shall cause all threads created with attr  to  be  in  the
42       joinable state. The default value of the detachstate attribute shall be
43       PTHREAD_CREATE_JOINABLE.
44

RETURN VALUE

46       Upon   successful   completion,    pthread_attr_getdetachstate()    and
47       pthread_attr_setdetachstate()  shall return a value of 0; otherwise, an
48       error number shall be returned to indicate the error.
49
50       The pthread_attr_getdetachstate() function  stores  the  value  of  the
51       detachstate attribute in detachstate if successful.
52

ERRORS

54       The pthread_attr_setdetachstate() function shall fail if:
55
56       EINVAL The value of detachstate was not valid
57
58
59       These functions shall not return an error code of [EINTR].
60
61       The following sections are informative.
62

EXAMPLES

64       None.
65

APPLICATION USAGE

67       None.
68

RATIONALE

70       None.
71

FUTURE DIRECTIONS

73       None.
74

SEE ALSO

76       pthread_attr_destroy(),  pthread_attr_getstackaddr(), pthread_attr_get‐
77       stacksize(),  pthread_create(),  the   Base   Definitions   volume   of
78       IEEE Std 1003.1-2001, <pthread.h>
79
81       Portions  of  this text are reprinted and reproduced in electronic form
82       from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
83       --  Portable  Operating  System  Interface (POSIX), The Open Group Base
84       Specifications Issue 6, Copyright (C) 2001-2003  by  the  Institute  of
85       Electrical  and  Electronics  Engineers, Inc and The Open Group. In the
86       event of any discrepancy between this version and the original IEEE and
87       The  Open Group Standard, the original IEEE and The Open Group Standard
88       is the referee document. The original Standard can be  obtained  online
89       at http://www.opengroup.org/unix/online.html .
90
91
92
93IEEE/The Open Group                  2003      PTHREAD_ATTR_GETDETACHSTATE(3P)
Impressum