~ubuntu-branches/ubuntu/precise/manpages-posix/precise

1 by Francesco Paolo Lovergine
rules: linking manpages-posix not manpages.
1
.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved 
2 by Francesco Paolo Lovergine
* Alligned to linux main manpages edition.
2
.TH "PTHREAD_ATTR_GETDETACHSTATE" P 2003 "IEEE/The Open Group" "POSIX Programmer's Manual"
1 by Francesco Paolo Lovergine
rules: linking manpages-posix not manpages.
3
.\" pthread_attr_getdetachstate 
4
.SH NAME
5
pthread_attr_getdetachstate, pthread_attr_setdetachstate \- get and
6
set the detachstate attribute
7
.SH SYNOPSIS
8
.LP
9
\fB#include <pthread.h>
10
.br
11
.sp
12
int pthread_attr_getdetachstate(const pthread_attr_t *\fP\fIattr\fP\fB,
13
.br
14
\ \ \ \ \ \  int *\fP\fIdetachstate\fP\fB);
15
.br
16
int pthread_attr_setdetachstate(pthread_attr_t *\fP\fIattr\fP\fB,
17
int\fP \fIdetachstate\fP\fB); \fP
18
\fB
19
.br
20
\fP
21
.SH DESCRIPTION
22
.LP
23
The \fIdetachstate\fP attribute controls whether the thread is created
24
in a detached state. If the thread is created detached,
25
then use of the ID of the newly created thread by the \fIpthread_detach\fP()
26
or \fIpthread_join\fP() function is an error.
27
.LP
28
The \fIpthread_attr_getdetachstate\fP() and \fIpthread_attr_setdetachstate\fP()
29
functions, respectively, shall get and set the
30
\fIdetachstate\fP attribute in the \fIattr\fP object.
31
.LP
32
For \fIpthread_attr_getdetachstate\fP(), \fIdetachstate\fP shall be
33
set to either PTHREAD_CREATE_DETACHED or
34
PTHREAD_CREATE_JOINABLE.
35
.LP
36
For \fIpthread_attr_setdetachstate\fP(), the application shall set
37
\fIdetachstate\fP to either PTHREAD_CREATE_DETACHED or
38
PTHREAD_CREATE_JOINABLE.
39
.LP
40
A value of PTHREAD_CREATE_DETACHED shall cause all threads created
41
with \fIattr\fP to be in the detached state, whereas using a
42
value of PTHREAD_CREATE_JOINABLE shall cause all threads created with
43
\fIattr\fP to be in the joinable state. The default value of
44
the \fIdetachstate\fP attribute shall be PTHREAD_CREATE_JOINABLE.
45
.SH RETURN VALUE
46
.LP
47
Upon successful completion, \fIpthread_attr_getdetachstate\fP() and
48
\fIpthread_attr_setdetachstate\fP() shall return a value
49
of 0; otherwise, an error number shall be returned to indicate the
50
error.
51
.LP
52
The \fIpthread_attr_getdetachstate\fP() function stores the value
53
of the \fIdetachstate\fP attribute in \fIdetachstate\fP if
54
successful.
55
.SH ERRORS
56
.LP
57
The \fIpthread_attr_setdetachstate\fP() function shall fail if:
58
.TP 7
59
.B EINVAL
60
The value of \fIdetachstate\fP was not valid
61
.sp
62
.LP
63
These functions shall not return an error code of [EINTR].
64
.LP
65
\fIThe following sections are informative.\fP
66
.SH EXAMPLES
67
.LP
68
None.
69
.SH APPLICATION USAGE
70
.LP
71
None.
72
.SH RATIONALE
73
.LP
74
None.
75
.SH FUTURE DIRECTIONS
76
.LP
77
None.
78
.SH SEE ALSO
79
.LP
80
\fIpthread_attr_destroy\fP() , \fIpthread_attr_getstackaddr\fP() ,
81
\fIpthread_attr_getstacksize\fP() , \fIpthread_create\fP()
82
, the Base Definitions volume of IEEE\ Std\ 1003.1-2001, \fI<pthread.h>\fP
83
.SH COPYRIGHT
84
Portions of this text are reprinted and reproduced in electronic form
85
from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
86
-- Portable Operating System Interface (POSIX), The Open Group Base
87
Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
88
Electrical and Electronics Engineers, Inc and The Open Group. In the
89
event of any discrepancy between this version and the original IEEE and
90
The Open Group Standard, the original IEEE and The Open Group Standard
91
is the referee document. The original Standard can be obtained online at
92
http://www.opengroup.org/unix/online.html .