1PTHREAD_ATTR_GETDETACHSTATE(PPO)SIX Programmer's ManPuTaHlREAD_ATTR_GETDETACHSTATE(P)
2
3
4

NAME

6       pthread_attr_getdetachstate,  pthread_attr_setdetachstate - get and set
7       the detachstate attribute
8

SYNOPSIS

10       #include <pthread.h>
11
12       int pthread_attr_getdetachstate(const pthread_attr_t *attr,
13              int *detachstate);
14       int pthread_attr_setdetachstate(pthread_attr_t *attr, int detachstate);
15
16

DESCRIPTION

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

RETURN VALUE

40       Upon    successful    completion,   pthread_attr_getdetachstate()   and
41       pthread_attr_setdetachstate() shall return a value of 0; otherwise,  an
42       error number shall be returned to indicate the error.
43
44       The  pthread_attr_getdetachstate()  function  stores  the  value of the
45       detachstate attribute in detachstate if successful.
46

ERRORS

48       The pthread_attr_setdetachstate() function shall fail if:
49
50       EINVAL The value of detachstate was not valid
51
52
53       These functions shall not return an error code of [EINTR].
54
55       The following sections are informative.
56

EXAMPLES

58       None.
59

APPLICATION USAGE

61       None.
62

RATIONALE

64       None.
65

FUTURE DIRECTIONS

67       None.
68

SEE ALSO

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