OSDN Git Service

(split) DP: release pages (catch up to 3.50).
[linuxjm/LDP_man-pages.git] / release / man3 / pthread_attr_setdetachstate.3
1 .\" Copyright (c) 2008 Linux Foundation, written by Michael Kerrisk
2 .\"     <mtk.manpages@gmail.com>
3 .\"
4 .\" %%%LICENSE_START(VERBATIM)
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
8 .\"
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
13 .\"
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein.  The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
20 .\" professionally.
21 .\"
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
24 .\" %%%LICENSE_END
25 .\"
26 .\"*******************************************************************
27 .\"
28 .\" This file was generated with po4a. Translate the source file.
29 .\"
30 .\"*******************************************************************
31 .TH PTHREAD_ATTR_SETDETACHSTATE 3 2010\-02\-03 Linux "Linux Programmer's Manual"
32 .SH 名前
33 pthread_attr_setdetachstate, pthread_attr_getdetachstate \-
34 スレッド属性オブジェクトの detach state 属性の設定/取得を行う
35 .SH 書式
36 .nf
37 \fB#include <pthread.h>\fP
38
39 \fBint pthread_attr_setdetachstate(pthread_attr_t *\fP\fIattr\fP\fB, int \fP\fIdetachstate\fP\fB);\fP
40 \fBint pthread_attr_getdetachstate(pthread_attr_t *\fP\fIattr\fP\fB, int *\fP\fIdetachstate\fP\fB);\fP
41 .sp
42 \fI\-pthread\fP でコンパイルしてリンクする。
43 .fi
44 .SH 説明
45 \fBpthread_attr_setdetachstate\fP() 関数は、
46 \fIattr\fP が参照するスレッド属性オブジェクトの detach state 属性を
47 \fIdetachstate\fP で指定された値に設定する。
48 detach state 属性により、スレッド属性オブジェクト \fIattr\fP を使って
49 作成されるスレッドが、 join 可能な状態で作成されるか、
50 detached (切り離された) 状態で作成されるかが決定される。
51
52 \fIdetachstate\fP には以下の値を指定できる。
53 .TP 
54 \fBPTHREAD_CREATE_DETACHED\fP
55 \fIattr\fP を使って作成されるスレッドは detached 状態で作成される。
56 .TP 
57 \fBPTHREAD_CREATE_JOINABLE\fP
58 \fIattr\fP を使って作成されるスレッドは join 可能な状態で作成される。
59 .PP
60 新規に初期化されたスレッド属性オブジェクトの detach state 属性の
61 デフォルト設定は \fBPTHREAD_CREATE_JOINABLE\fP である。
62
63 \fBpthread_attr_getdetachstate\fP() は、
64 スレッド属性オブジェクト \fIattr\fP の detach state 属性を
65 \fIdetachstate\fP が指すバッファに入れて返す。
66 .SH 返り値
67 成功すると、これらの関数は 0 を返す。
68 エラーの場合、0 以外のエラー番号を返す。
69 .SH エラー
70 \fBpthread_attr_setdetachstate\fP() は以下のエラーで失敗する場合がある。
71 .TP 
72 \fBEINVAL\fP
73 無効な値が \fIdetachstate\fP で指定された。
74 .SH 準拠
75 POSIX.1\-2001.
76 .SH 注意
77 detached 状態のスレッド、join 可能状態のスレッドの詳細については、
78 \fBpthread_create\fP(3) を参照。
79
80 join 可能状態で作成されたスレッドは、最終的に
81 \fBpthread_join\fP(3) を使って join するか、
82 \fBpthread_detach\fP(3) を使って切り離すか、
83 のどちらかを行うべきである。
84
85 detached 状態で作成されたスレッドのスレッド ID を指定して、
86 \fBpthread_detach\fP(3) や \fBpthread_join\fP(3) を後から呼び出すのは
87 エラーである。
88 .SH 例
89 \fBpthread_attr_init\fP(3) を参照。
90 .SH 関連項目
91 \fBpthread_attr_init\fP(3), \fBpthread_create\fP(3), \fBpthread_detach\fP(3),
92 \fBpthread_join\fP(3), \fBpthreads\fP(7)
93 .SH この文書について
94 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.50 の一部
95 である。プロジェクトの説明とバグ報告に関する情報は
96 http://www.kernel.org/doc/man\-pages/ に書かれている。