1 .\" Copyright (C) 1996-1999 Free Software Foundation, Inc.
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.
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.
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.
17 .\" Copyright (C) 1996 Xavier Leroy.
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.
29 .\"WORD: joinable 合流可能
31 .\"WORD: real-time リアルタイム
32 .\"WORD: identifier 識別子
33 .\"WORD: error code エラーコード
34 .TH PTHREAD_CREATE 3 LinuxThreads
37 .\"O pthread_create \- create a new thread
39 pthread_create \- 新しいスレッドを生成する
43 .B #include <pthread.h>
45 .BI "int pthread_create(pthread_t * " thread ", pthread_attr_t * " attr ", void * (*" start_routine ")(void *), void * " arg ");"
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
52 .\"O .I "start_routine"
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"
61 .\"O latter case is equivalent to calling
62 .\"O .BR "pthread_exit" (3)
65 .\"O .I "start_routine"
69 は呼び出しスレッドと並行して実行する、新しい制御スレッドを生成する。
76 .BR "pthread_exit" (3)
80 から返ることで暗黙的に終了する。後者の場合は、
83 .BR "pthread_exit" (3)
88 .\"O argument specifies thread attributes to be applied to the
90 .\"O .BR "pthread_attr_init" (3)
91 .\"O for a complete list of thread
94 .\"O argument can also be
97 .\"O default attributes are used: the created thread is joinable (not
98 .\"O detached) and has default (non real-time) scheduling policy.
101 には、その新しいスレッドに適用するスレッド属性を指定する。
103 .BR "pthread_attr_init" (3)
109 をとることができ、その時はデフォルトの属性が用いられる:
110 生成したスレッドは合流可能で (つまりデタッチされない)、
111 デフォルト (つまりリアルタイムではない) のスケジューリング方針になる。
113 .\"O .SH "RETURN VALUE"
115 .\"O On success, the identifier of the newly created thread is stored in
116 .\"O the location pointed by the
118 .\"O argument, and a 0 is returned. On
119 .\"O error, a non-zero error code is returned.
120 成功すると新しく作成したスレッドの識別子が
124 エラーの場合、非 0 のエラーコードが返る。
130 .\"O not enough system resources to create a process for the new thread.
134 .\"O .B "PTHREAD_THREADS_MAX"
135 .\"O threads are already active.
138 新しいスレッドのプロセスを生成するための十分なシステム資源がない。
141 .B "PTHREAD_THREADS_MAX"
142 よりも多くのスレッドが既にアクティブである。
146 Xavier Leroy <Xavier.Leroy@inria.fr>
150 .BR "pthread_exit" (3),
151 .BR "pthread_join" (3),
152 .BR "pthread_detach" (3),
153 .BR "pthread_attr_init" (3).