OSDN Git Service

Convert release and draft pages to UTF-8.
[linuxjm/jm.git] / manual / glibc-linuxthreads / draft / man3 / pthread_create.3
1 .\"   Copyright (C) 1996-1999 Free Software Foundation, Inc.
2 .\"
3 .\"   Permission is granted to make and distribute verbatim copies of
4 .\" this manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
6 .\"
7 .\"   Permission is granted to copy and distribute modified versions of
8 .\" this manual under the conditions for verbatim copying, provided that
9 .\" the entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
11 .\"
12 .\"   Permission is granted to copy and distribute translations of this
13 .\" manual into another language, under the above conditions for modified
14 .\" versions, except that this permission notice may be stated in a
15 .\" translation approved by the Foundation.
16 .\"
17 .\" Copyright (C) 1996 Xavier Leroy.
18 .\" 
19 .\" Japanese Version Copyright (C) 1999 GOTO, Masanori
20 .\"         all rights reserved.
21 .\" Translated on Tue Dec 14 21:30:57 JST 1999
22 .\"         by GOTO, Masanori <gotom@debian.or.jp>.
23 .\" Modified Sun Feb  2 00:36:21 JST 2003
24 .\"         by Suzuki Takashi.
25 .\"
26 .\"WORD:    thread              スレッド
27 .\"WORD:    create              生成
28 .\"WORD:    attribute           属性
29 .\"WORD:    joinable            合流可能
30 .\"WORD:    detach              デタッチ
31 .\"WORD:    real-time           リアルタイム
32 .\"WORD:    identifier          識別子
33 .\"WORD:    error code          エラーコード
34 .TH PTHREAD_CREATE 3 LinuxThreads
35
36 .\"O .SH NAME
37 .\"O pthread_create \- create a new thread
38 .SH "名前"
39 pthread_create \- 新しいスレッドを生成する
40
41 .\"O .SH SYNOPSIS
42 .SH "書式"
43 .B #include <pthread.h>
44
45 .BI "int pthread_create(pthread_t * " thread ", pthread_attr_t * " attr ", void * (*" start_routine ")(void *), void * " arg ");"
46
47 .\"O .SH DESCRIPTION
48 .\"O .B "pthread_create"
49 .\"O creates a new thread of control that executes
50 .\"O concurrently with the calling thread. The new thread applies the
51 .\"O function 
52 .\"O .I "start_routine"
53 .\"O passing it 
54 .\"O .I "arg"
55 .\"O as first argument. The new
56 .\"O thread terminates either explicitly, by calling 
57 .\"O .BR "pthread_exit" (3),
58 .\"O or implicitly, by returning from the 
59 .\"O .I "start_routine"
60 .\"O function. The
61 .\"O latter case is equivalent to calling 
62 .\"O .BR "pthread_exit" (3)
63 .\"O with the result
64 .\"O returned by 
65 .\"O .I "start_routine"
66 .\"O as exit code.
67 .SH "説明"
68 .B "pthread_create"
69 は呼び出しスレッドと並行して実行する、新しい制御スレッドを生成する。
70 新しいスレッドは、
71 .I "arg"
72 を第 1 引数とする
73 .I "start_routine"
74 という関数になる。
75 新しいスレッドは、
76 .BR "pthread_exit" (3)
77 を呼び出すことによって明示的に終了するか、
78 関数
79 .I "start_routine"
80 から返ることで暗黙的に終了する。後者の場合は、
81 .I "start_routine"
82 の終了コードとして返す結果を引数として
83 .BR "pthread_exit" (3)
84 を呼び出すことに等しい。
85
86 .\"O The 
87 .\"O .I "attr"
88 .\"O argument specifies thread attributes to be applied to the
89 .\"O new thread. See 
90 .\"O .BR "pthread_attr_init" (3)
91 .\"O for a complete list of thread
92 .\"O attributes. The 
93 .\"O .I "attr"
94 .\"O argument can also be 
95 .\"O .BR "NULL" ,
96 .\"O in which case
97 .\"O default attributes are used: the created thread is joinable (not
98 .\"O detached) and has default (non real-time) scheduling policy.
99 引数
100 .I "attr"
101 には、その新しいスレッドに適用するスレッド属性を指定する。
102 スレッド属性に関する完全なリストは
103 .BR "pthread_attr_init" (3)
104 に見つけることができる。
105 引数
106 .I "attr"
107 はまた
108 .B "NULL"
109 をとることができ、その時はデフォルトの属性が用いられる:
110 生成したスレッドは合流可能で (つまりデタッチされない)、
111 デフォルト (つまりリアルタイムではない) のスケジューリング方針になる。
112
113 .\"O .SH "RETURN VALUE"
114 .SH "返り値"
115 .\"O On success, the identifier of the newly created thread is stored in
116 .\"O the location pointed by the 
117 .\"O .I "thread"
118 .\"O argument, and a 0 is returned. On
119 .\"O error, a non-zero error code is returned.
120 成功すると新しく作成したスレッドの識別子が
121 引数
122 .I "thread"
123 の指す領域へ格納され、 0 が返る。
124 エラーの場合、非 0 のエラーコードが返る。
125
126 .\"O .SH ERRORS
127 .SH "エラー"
128 .\"O .TP
129 .\"O .B "EAGAIN"
130 .\"O not enough system resources to create a process for the new thread.
131 .\"O .TP
132 .\"O .B "EAGAIN"
133 .\"O more than 
134 .\"O .B "PTHREAD_THREADS_MAX"
135 .\"O threads are already active.
136 .TP
137 .B "EAGAIN"
138 新しいスレッドのプロセスを生成するための十分なシステム資源がない。
139 .TP
140 .B "EAGAIN"
141 .B "PTHREAD_THREADS_MAX"
142 よりも多くのスレッドが既にアクティブである。
143
144 .\"O .SH AUTHOR
145 .SH "著者"
146 Xavier Leroy <Xavier.Leroy@inria.fr>
147
148 .\"O .SH "SEE ALSO"
149 .SH "関連項目"
150 .BR "pthread_exit" (3),
151 .BR "pthread_join" (3),
152 .BR "pthread_detach" (3),
153 .BR "pthread_attr_init" (3).