OSDN Git Service

cdfae9ee5f6d7e3d3ab025f52fd13bcd5a4b9086
[linuxjm/LDP_man-pages.git] / draft / man7 / pthreads.7
1 '\" t
2 .\" Copyright (c) 2005 by Michael Kerrisk <mtk.manpages@gmail.com>
3 .\"
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
7 .\"
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
12 .\"
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein.  The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
19 .\" professionally.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\"
24 .\" Japanese Version Copyright (c) 2005 Akihiro MOTOKI all rights reserved.
25 .\" Translated 2005-09-06, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
26 .\" Updated 2006-04-15, Akihiro MOTOKI, LDP v2.29
27 .\" Updated 2007-01-05, Akihiro MOTOKI, LDP v2.43
28 .\" Updated 2008-08-08, Akihiro MOTOKI, LDP v3.05
29 .\" Updated 2008-11-05, Akihiro MOTOKI, LDP v3.12
30 .\" Updated 2008-11-09, Akihiro MOTOKI, LDP v3.13
31 .\" Updated 2008-12-26, Akihiro MOTOKI, LDP v3.14
32 .\"
33 .\"WORD:        manager thread          管理スレッド
34 .\"WORD:        thread group            スレッド・グループ
35 .\"WORD:        real-time signal        リアルタイムシグナル
36 .\"WORD:        non-conformant          標準非準拠の
37 .\"WORD:        alternate signal stack  代替シグナルスタック
38 .\"
39 .TH PTHREADS 7  2008-11-18 "Linux" "Linux Programmer's Manual"
40 .\"O .SH NAME
41 .SH 名前
42 .\"O pthreads \- POSIX threads
43 pthreads \- POSIX スレッド
44 .\"O .SH DESCRIPTION
45 .SH 説明
46 .\"O POSIX.1 specifies a set of interfaces (functions, header files) for
47 .\"O threaded programming commonly known as POSIX threads, or Pthreads.
48 .\"O A single process can contain multiple threads,
49 .\"O all of which are executing the same program.
50 .\"O These threads share the same global memory (data and heap segments),
51 .\"O but each thread has its own stack (automatic variables).
52 POSIX.1 は、一般に POSIX スレッドや Pthreads として知られる
53 スレッド・プログラミングのインタフェース群 (関数、ヘッダファイル)
54 を規定している。一つのプロセスは複数のスレッドを持つことができ、
55 全てのスレッドは同じプログラムを実行する。
56 これらのスレッドは同じ大域メモリ (データとヒープ領域) を共有するが、
57 各スレッドは自分専用のスタック (自動変数) を持つ。
58
59 .\"O POSIX.1 also requires that threads share a range of other attributes
60 .\"O (i.e., these attributes are process-wide rather than per-thread):
61 POSIX.1 はスレッド間でどのような属性を共有するかについても定めている
62 (つまり、これらの属性はスレッド単位ではなくプロセス全体で共通である):
63 .IP \- 3
64 .\"O process ID
65 プロセス ID
66 .IP \- 3
67 .\"O parent process ID
68 親プロセス ID
69 .IP \- 3
70 .\"O process group ID and session ID
71 プロセスグループ ID とセッション ID
72 .IP \- 3
73 .\"O controlling terminal
74 制御端末
75 .IP \- 3
76 .\"O user and group IDs
77 ユーザ ID とグループ ID
78 .IP \- 3
79 .\"O open file descriptors
80 オープンするファイルディスクリプタ
81 .IP \- 3
82 .\"O record locks (see
83 .\"O .BR fcntl (2))
84 レコードのロック
85 .RB ( fcntl (3)
86 参照)
87 .IP \- 3
88 .\"O signal dispositions
89 シグナルの配置
90 .IP \- 3
91 .\"O file mode creation mask
92 .\"O .RB ( umask (2))
93 ファイルモード作成マスク
94 .RB ( umask (2))
95 .IP \- 3
96 .\"O current directory
97 カレント・ディレクトリ
98 .RB ( chdir (2))
99 .\"O and
100 .\"O root directory
101 とルート・ディレクトリ
102 .RB ( chroot (2))
103 .IP \- 3
104 .\"O interval timers
105 インターバル・タイマ
106 .RB ( setitimer (2))
107 .\"O and POSIX timers
108 と POSIX タイマ
109 .RB ( timer_create (2))
110 .IP \- 3
111 .\"O nice value
112 nice 値
113 .RB ( setpriority (2))
114 .IP \- 3
115 .\"O resource limits
116 リソース制限
117 .RB ( setrlimit (2))
118 .IP \- 3
119 .\"O measurements of the consumption of CPU time
120 .\"O .RB ( times (2))
121 .\"O and resources
122 .\"O .RB ( getrusage (2))
123 CPU 時間
124 .RB ( times (2))
125 とリソース
126 .RB ( getrusage (2))
127 の消費状況の計測
128 .PP
129 .\"O As well as the stack, POSIX.1 specifies that various other
130 .\"O attributes are distinct for each thread, including:
131 スタックについても、POSIX.1 はどのような属性が
132 個々のスレッドで独立に管理されるかを規定している:
133 .IP \- 3
134 .\"O thread ID (the
135 .\"O .I pthread_t
136 .\"O data type)
137 スレッド ID
138 .RB ( pthread_t
139 データ型)
140 .IP \- 3
141 .\"O signal mask
142 シグナルマスク
143 .RB ( pthread_sigmask (3))
144 .IP \- 3
145 .\"O the
146 .\"O .I errno
147 .\"O variable
148 .I errno
149 変数
150 .IP \- 3
151 .\"O alternate signal stack
152 代替シグナルスタック
153 .RB ( sigaltstack (2))
154 .IP \- 3
155 .\"O real-time scheduling policy and priority
156 リアルタイム・スケジューリングのポリシーと優先度
157 .RB ( sched_setscheduler (2)
158 .\"O and
159
160 .BR sched_setparam (2))
161 .PP
162 .\"O The following Linux-specific features are also per-thread:
163 以下の Linux 特有の機能もスレッド単位である:
164 .IP \- 3
165 .\"O capabilities (see
166 .\"O .BR capabilities (7))
167 ケーパビリティ
168 .RB ( capabilities (7)
169 参照)
170 .IP \- 3
171 .\"O CPU affinity
172 CPU affinity (親和度)
173 .RB ( sched_setaffinity (2))
174 .\"O .SS "Pthreads function return values"
175 .SS "pthreads 関数の返り値"
176 .\"O Most pthreads functions return 0 on success, and an error number of failure.
177 .\"O Note that the pthreads functions do not set
178 .\"O .IR errno .
179 .\"O For each of the pthreads functions that can return an error,
180 .\"O POSIX.1-2001 specifies that the function can never fail with the error
181 .\"O .BR EINTR .
182 ほとんどの pthreads 関数は成功すると 0 を返し、
183 失敗した場合エラー番号を返す。
184 pthreads 関数は
185 .I errno
186 をセットしない点に注意すること。
187 POSIX.1-2001 では、
188 エラーを返す可能性のある pthreads 関数がエラー
189 .B EINTR
190 で失敗することは決してないと規定している。
191 .\"O .SS Thread IDs
192 .SS "スレッド ID"
193 .\"O Each of the threads in a process has a unique thread identifier
194 .\"O (stored in the type
195 .\"O .IR pthread_t ).
196 .\"O This identifier is returned to the caller of
197 .\"O .BR pthread_create (3),
198 .\"O and a thread can obtain its own thread identifier using
199 .\"O .BR pthread_self (3).
200 .\"O Thread IDs are only guaranteed to be unique within a process.
201 .\"O A thread ID may be reused after a terminated thread has been joined,
202 .\"O or a detached thread has terminated.
203 .\"O In all pthreads functions that accept a thread ID as an argument,
204 .\"O that ID by definition refers to a thread in
205 .\"O the same process as the caller.
206 あるプロセス内の各スレッドは
207 .RI ( pthread_t
208 型の) 一意なスレッド識別子を持つ。
209 この識別子は、
210 .BR pthread_create (3)
211 の呼び出し元に返される。また、スレッドは自身のスレッド識別子を
212 .BR pthread_self (3)
213 を使って取得できる。
214 スレッド ID の一意性が保証されるのは、一つのプロセス内においてのみである。
215 終了したスレッドが join された後では、スレッド ID は再利用される可能性がある。
216 スレッド ID を引き数に取る全てのスレッド関数において、
217 その ID は呼び出し元と同じプロセス内の一つのスレッドを参照する。
218 .\"O .SS "Thread-safe functions"
219 .SS "スレッドセーフな関数"
220 .\"O A thread-safe function is one that can be safely
221 .\"O (i.e., it will deliver the same results regardless of whether it is)
222 .\"O called from multiple threads at the same time.
223 スレッドセーフな関数は、複数のスレッドから同時に呼び出しても安全な
224 (すなわち、同時に呼び出されたかに関わらず、同じ結果を返す) 関数のことである。
225
226 .\"O POSIX.1-2001 and POSIX.1-2008 require that all functions specified
227 .\"O in the standard shall be thread-safe,
228 .\"O except for the following functions:
229 POSIX.1-2001 と POSIX.1-2008では、一部の例外を除き、
230 標準で規定されている全ての関数がスレッドセーフであることを要求している。
231 以下の関数が例外である。
232 .in +4n
233 .nf
234
235 asctime()
236 basename()
237 catgets()
238 crypt()
239 .\"O ctermid() if passed a non-NULL argument
240 ctermid() (NULL でない引き数を渡された場合)
241 ctime()
242 dbm_clearerr()
243 dbm_close()
244 dbm_delete()
245 dbm_error()
246 dbm_fetch()
247 dbm_firstkey()
248 dbm_nextkey()
249 dbm_open()
250 dbm_store()
251 dirname()
252 dlerror()
253 drand48()
254 .\"O ecvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]
255 ecvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]
256 encrypt()
257 endgrent()
258 endpwent()
259 endutxent()
260 .\"O fcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]
261 fcvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]
262 ftw()
263 .\"O gcvt() [POSIX.1-2001 only (function removed in POSIX.1-2008)]
264 gcvt() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]
265 getc_unlocked()
266 getchar_unlocked()
267 getdate()
268 getenv()
269 getgrent()
270 getgrgid()
271 getgrnam()
272 .\"O gethostbyaddr() [POSIX.1-2001 only (function removed in POSIX.1-2008)]
273 .\"O gethostbyname() [POSIX.1-2001 only (function removed in POSIX.1-2008)]
274 gethostbyaddr() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]
275 gethostbyname() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]
276 gethostent()
277 getlogin()
278 getnetbyaddr()
279 getnetbyname()
280 getnetent()
281 getopt()
282 getprotobyname()
283 getprotobynumber()
284 getprotoent()
285 getpwent()
286 getpwnam()
287 getpwuid()
288 getservbyname()
289 getservbyport()
290 getservent()
291 getutxent()
292 getutxid()
293 getutxline()
294 gmtime()
295 hcreate()
296 hdestroy()
297 hsearch()
298 inet_ntoa()
299 l64a()
300 lgamma()
301 lgammaf()
302 lgammal()
303 localeconv()
304 localtime()
305 lrand48()
306 mrand48()
307 nftw()
308 nl_langinfo()
309 ptsname()
310 putc_unlocked()
311 putchar_unlocked()
312 putenv()
313 pututxline()
314 rand()
315 readdir()
316 setenv()
317 setgrent()
318 setkey()
319 setpwent()
320 setutxent()
321 strerror()
322 .\"O strsignal() [Added in POSIX.1-2008]
323 strsignal() [POSIX.1-2008 で追加された]
324 strtok()
325 .\"O system() [Added in POSIX.1-2008]
326 system() [POSIX.1-2008 で追加された]
327 .\"O tmpnam() if passed a non-NULL argument
328 tmpnam() (NULL でない引き数を渡された場合)
329 ttyname()
330 unsetenv()
331 .\"O wcrtomb() if its final argument is NULL
332 wcrtomb() (最後の引き数が NULL の場合)
333 .\"O wcsrtombs() if its final argument is NULL
334 wcsrtombs() (最後の引き数が NULL の場合)
335 wcstombs()
336 wctomb()
337 .fi
338 .in
339 .\"O .SS Cancellation Points
340 .SS 取り消しポイント (cancellation points)
341 .\"O POSIX.1 specifies that certain functions must,
342 .\"O and certain other functions may, be cancellation points.
343 .\"O If a thread is cancelable, its cancelability type is deferred,
344 .\"O and a cancellation request is pending for the thread,
345 .\"O then the thread is canceled when it calls a function
346 .\"O that is a cancellation point.
347 POSIX.1 の規定では、特定の関数は取り消しポイントでなければならず、
348 他の特定の関数は取り消しポイントであってもよいとされている。
349 あるスレッドが取り消し可能で、その取り消し種別 (cancelability type)
350 が延期 (deferred) で、そのスレッドに対する取り消し要求が処理待ちの場合、
351 取り消しポイントである関数を呼び出した時点で、そのスレッドのキャンセルが
352 行われる。
353
354 .\"O The following functions are required to be cancellation points by
355 .\"O POSIX.1-2001 and/or POSIX.1-2008:
356 POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、
357 以下の関数は、取り消しポイント (cancellation points) で
358 あることが必須となっている。
359
360 .\" FIXME
361 .\" Document the list of all functions that are cancellation points in glibc
362 .in +4n
363 .nf
364 accept()
365 aio_suspend()
366 clock_nanosleep()
367 close()
368 connect()
369 creat()
370 fcntl() F_SETLKW
371 fdatasync()
372 fsync()
373 getmsg()
374 getpmsg()
375 lockf() F_LOCK
376 mq_receive()
377 mq_send()
378 mq_timedreceive()
379 mq_timedsend()
380 msgrcv()
381 msgsnd()
382 msync()
383 nanosleep()
384 open()
385 .\"O openat() [Added in POSIX.1-2008]
386 openat() [POSIX.1-2008 で追加された]
387 pause()
388 poll()
389 pread()
390 pselect()
391 pthread_cond_timedwait()
392 pthread_cond_wait()
393 pthread_join()
394 pthread_testcancel()
395 putmsg()
396 putpmsg()
397 pwrite()
398 read()
399 readv()
400 recv()
401 recvfrom()
402 recvmsg()
403 select()
404 sem_timedwait()
405 sem_wait()
406 send()
407 sendmsg()
408 sendto()
409 .\"O sigpause() [POSIX.1-2001 only (moves to "may" list in POSIX.1-2008)]
410 sigpause() [POSIX.1-2001 only (moves to "may" list in POSIX.1-2008)]
411 sigsuspend()
412 sigtimedwait()
413 sigwait()
414 sigwaitinfo()
415 sleep()
416 system()
417 tcdrain()
418 .\"O usleep() [POSIX.1-2001 only (function removed in POSIX.1-2008)]
419 usleep() [POSIX.1-2001 のみ (POSIX.1-2008 で削除された)]
420 wait()
421 waitid()
422 waitpid()
423 write()
424 writev()
425 .fi
426 .in
427
428 .\"O The following functions may be cancellation points according to
429 .\"O POSIX.1-2001 and/or POSIX.1-2008:
430 POSIX.1-2001 と POSIX.1-2008 の両方、もしくはいずれか一方では、
431 以下の関数は、取り消しポイント (cancellation points) で
432 あってもよいことになっている。
433
434 .in +4n
435 .nf
436 access()
437 asctime()
438 asctime_r()
439 catclose()
440 catgets()
441 catopen()
442 .\"O chmod() [Added in POSIX.1-2008]
443 .\"O chown() [Added in POSIX.1-2008]
444 chmod() [POSIX.1-2008 で追加された]
445 chown() [POSIX.1-2008 で追加された]
446 closedir()
447 closelog()
448 ctermid()
449 ctime()
450 ctime_r()
451 dbm_close()
452 dbm_delete()
453 dbm_fetch()
454 dbm_nextkey()
455 dbm_open()
456 dbm_store()
457 dlclose()
458 dlopen()
459 .\"O dprintf() [Added in POSIX.1-2008]
460 dprintf() [POSIX.1-2008 で追加された]
461 endgrent()
462 endhostent()
463 endnetent()
464 endprotoent()
465 endpwent()
466 endservent()
467 endutxent()
468 .\"O faccessat() [Added in POSIX.1-2008]
469 .\"O fchmod() [Added in POSIX.1-2008]
470 .\"O fchmodat() [Added in POSIX.1-2008]
471 .\"O fchown() [Added in POSIX.1-2008]
472 .\"O fchownat() [Added in POSIX.1-2008]
473 faccessat() [POSIX.1-2008 で追加された]
474 fchmod() [POSIX.1-2008 で追加された]
475 fchmodat() [POSIX.1-2008 で追加された]
476 fchown() [POSIX.1-2008 で追加された]
477 fchownat() [POSIX.1-2008 で追加された]
478 fclose()
479 .\"O fcntl() (for any value of cmd argument)
480 fcntl() (cmd 引き数が何であっても)
481 fflush()
482 fgetc()
483 fgetpos()
484 fgets()
485 fgetwc()
486 fgetws()
487 fmtmsg()
488 fopen()
489 fpathconf()
490 fprintf()
491 fputc()
492 fputs()
493 fputwc()
494 fputws()
495 fread()
496 freopen()
497 fscanf()
498 fseek()
499 fseeko()
500 fsetpos()
501 fstat()
502 .\"O fstatat() [Added in POSIX.1-2008]
503 fstatat() [POSIX.1-2008 で追加された]
504 ftell()
505 ftello()
506 ftw()
507 .\"O futimens() [Added in POSIX.1-2008]
508 futimens() [POSIX.1-2008 で追加された]
509 fwprintf()
510 fwrite()
511 fwscanf()
512 getaddrinfo()
513 getc()
514 getc_unlocked()
515 getchar()
516 getchar_unlocked()
517 getcwd()
518 getdate()
519 .\"O getdelim() [Added in POSIX.1-2008]
520 getdelim() [POSIX.1-2008 で追加された]
521 getgrent()
522 getgrgid()
523 getgrgid_r()
524 getgrnam()
525 getgrnam_r()
526 .\"O gethostbyaddr() [SUSv3 only (function removed in POSIX.1-2008)]
527 .\"O gethostbyname() [SUSv3 only (function removed in POSIX.1-2008)]
528 gethostbyaddr() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]
529 gethostbyname() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]
530 gethostent()
531 gethostid()
532 gethostname()
533 .\"O getline() [Added in POSIX.1-2008]
534 getline() [POSIX.1-2008 で追加された]
535 getlogin()
536 getlogin_r()
537 getnameinfo()
538 getnetbyaddr()
539 getnetbyname()
540 getnetent()
541 .\"O getopt() (if opterr is nonzero)
542 getopt() (opterr が 0 以外の場合)
543 getprotobyname()
544 getprotobynumber()
545 getprotoent()
546 getpwent()
547 getpwnam()
548 getpwnam_r()
549 getpwuid()
550 getpwuid_r()
551 gets()
552 getservbyname()
553 getservbyport()
554 getservent()
555 getutxent()
556 getutxid()
557 getutxline()
558 getwc()
559 getwchar()
560 .\"O getwd() [SUSv3 only (function removed in POSIX.1-2008)]
561 getwd() [SUSv3 のみ (この関数は POSIX.1-2008 で削除されている)]
562 glob()
563 iconv_close()
564 iconv_open()
565 ioctl()
566 link()
567 .\"O linkat() [Added in POSIX.1-2008]
568 .\"O lio_listio() [Added in POSIX.1-2008]
569 linkat() [POSIX.1-2008 で追加された]
570 lio_listio() [POSIX.1-2008 で追加された]
571 localtime()
572 localtime_r()
573 .\"O lockf() [Added in POSIX.1-2008]
574 lockf() [POSIX.1-2008 で追加された]
575 lseek()
576 lstat()
577 .\"O mkdir() [Added in POSIX.1-2008]
578 .\"O mkdirat() [Added in POSIX.1-2008]
579 .\"O mkdtemp() [Added in POSIX.1-2008]
580 .\"O mkfifo() [Added in POSIX.1-2008]
581 .\"O mkfifoat() [Added in POSIX.1-2008]
582 .\"O mknod() [Added in POSIX.1-2008]
583 .\"O mknodat() [Added in POSIX.1-2008]
584 mkdir() [POSIX.1-2008 で追加された]
585 mkdirat() [POSIX.1-2008 で追加された]
586 mkdtemp() [POSIX.1-2008 で追加された]
587 mkfifo() [POSIX.1-2008 で追加された]
588 mkfifoat() [POSIX.1-2008 で追加された]
589 mknod() [POSIX.1-2008 で追加された]
590 mknodat() [POSIX.1-2008 で追加された]
591 mkstemp()
592 mktime()
593 nftw()
594 opendir()
595 openlog()
596 pathconf()
597 pclose()
598 perror()
599 popen()
600 posix_fadvise()
601 posix_fallocate()
602 posix_madvise()
603 posix_openpt()
604 posix_spawn()
605 posix_spawnp()
606 posix_trace_clear()
607 posix_trace_close()
608 posix_trace_create()
609 posix_trace_create_withlog()
610 posix_trace_eventtypelist_getnext_id()
611 posix_trace_eventtypelist_rewind()
612 posix_trace_flush()
613 posix_trace_get_attr()
614 posix_trace_get_filter()
615 posix_trace_get_status()
616 posix_trace_getnext_event()
617 posix_trace_open()
618 posix_trace_rewind()
619 posix_trace_set_filter()
620 posix_trace_shutdown()
621 posix_trace_timedgetnext_event()
622 posix_typed_mem_open()
623 printf()
624 .\"O psiginfo() [Added in POSIX.1-2008]
625 .\"O psignal() [Added in POSIX.1-2008]
626 psiginfo() [POSIX.1-2008 で追加された]
627 psignal() [POSIX.1-2008 で追加された]
628 pthread_rwlock_rdlock()
629 pthread_rwlock_timedrdlock()
630 pthread_rwlock_timedwrlock()
631 pthread_rwlock_wrlock()
632 putc()
633 putc_unlocked()
634 putchar()
635 putchar_unlocked()
636 puts()
637 pututxline()
638 putwc()
639 putwchar()
640 readdir()
641 readdir_r()
642 .\"O readlink() [Added in POSIX.1-2008]
643 .\"O readlinkat() [Added in POSIX.1-2008]
644 readlink() [POSIX.1-2008 で追加された]
645 readlinkat() [POSIX.1-2008 で追加された]
646 remove()
647 rename()
648 .\"O renameat() [Added in POSIX.1-2008]
649 renameat() [POSIX.1-2008 で追加された]
650 rewind()
651 rewinddir()
652 .\"O scandir() [Added in POSIX.1-2008]
653 scandir() [POSIX.1-2008 で追加された]
654 scanf()
655 seekdir()
656 semop()
657 setgrent()
658 sethostent()
659 setnetent()
660 setprotoent()
661 setpwent()
662 setservent()
663 setutxent()
664 .\"O sigpause() [Added in POSIX.1-2008]
665 sigpause() [POSIX.1-2008 で追加された]
666 stat()
667 strerror()
668 strerror_r()
669 strftime()
670 symlink()
671 .\"O symlinkat() [Added in POSIX.1-2008]
672 symlinkat() [POSIX.1-2008 で追加された]
673 sync()
674 syslog()
675 tmpfile()
676 tmpnam()
677 ttyname()
678 ttyname_r()
679 tzset()
680 ungetc()
681 ungetwc()
682 unlink()
683 .\"O unlinkat() [Added in POSIX.1-2008]
684 .\"O utime() [Added in POSIX.1-2008]
685 .\"O utimensat() [Added in POSIX.1-2008]
686 .\"O utimes() [Added in POSIX.1-2008]
687 .\"O vdprintf() [Added in POSIX.1-2008]
688 unlinkat() [POSIX.1-2008 で追加された]
689 utime() [POSIX.1-2008 で追加された]
690 utimensat() [POSIX.1-2008 で追加された]
691 utimes() [POSIX.1-2008 で追加された]
692 vdprintf() [POSIX.1-2008 で追加された]
693 vfprintf()
694 vfwprintf()
695 vprintf()
696 vwprintf()
697 wcsftime()
698 wordexp()
699 wprintf()
700 wscanf()
701 .fi
702 .in
703
704 .\"O An implementation may also mark other functions
705 .\"O not specified in the standard as cancellation points.
706 .\"O In particular, an implementation is likely to mark
707 .\"O any nonstandard function that may block as a cancellation point.
708 .\"O (This includes most functions that can touch files.)
709 実装時に、標準規格で規定されていないその他の関数を取り消しポイント
710 とすることも認められている。
711 特に、停止 (block) する可能性がある非標準の関数を取り消しポイントと
712 する実装はあり得ることだろう
713 (ファイルを扱う可能性のあるほとんどの関数がこれに含まれる)。
714 .\" So, scanning "cancellation point" comments in the glibc 2.8 header
715 .\" files, it looks as though at least the following nonstandard
716 .\" functions are cancellation points:
717 .\" endnetgrent
718 .\" endspent
719 .\" epoll_pwait
720 .\" epoll_wait
721 .\" fcloseall
722 .\" fdopendir
723 .\" fflush_unlocked
724 .\" fgetc_unlocked
725 .\" fgetgrent
726 .\" fgetgrent_r
727 .\" fgetpwent
728 .\" fgetpwent_r
729 .\" fgets_unlocked
730 .\" fgetspent
731 .\" fgetspent_r
732 .\" fgetwc_unlocked
733 .\" fgetws_unlocked
734 .\" fputc_unlocked
735 .\" fputs_unlocked
736 .\" fputwc_unlocked
737 .\" fputws_unlocked
738 .\" fread_unlocked
739 .\" fwrite_unlocked
740 .\" gai_suspend
741 .\" getaddrinfo_a
742 .\" getdate_r
743 .\" getgrent_r
744 .\" getgrouplist
745 .\" gethostbyaddr_r
746 .\" gethostbyname2
747 .\" gethostbyname2_r
748 .\" gethostbyname_r
749 .\" gethostent_r
750 .\" getnetbyaddr_r
751 .\" getnetbyname_r
752 .\" getnetent_r
753 .\" getnetgrent
754 .\" getnetgrent_r
755 .\" getprotobyname_r
756 .\" getprotobynumber_r
757 .\" getprotoent_r
758 .\" getpw
759 .\" getpwent_r
760 .\" getservbyname_r
761 .\" getservbyport_r
762 .\" getservent_r
763 .\" getspent
764 .\" getspent_r
765 .\" getspnam
766 .\" getspnam_r
767 .\" getutmp
768 .\" getutmpx
769 .\" getw
770 .\" getwc_unlocked
771 .\" getwchar_unlocked
772 .\" initgroups
773 .\" innetgr
774 .\" mkostemp
775 .\" mkostemp64
776 .\" mkstemp64
777 .\" ppoll
778 .\" pthread_timedjoin_np
779 .\" putgrent
780 .\" putpwent
781 .\" putspent
782 .\" putw
783 .\" putwc_unlocked
784 .\" putwchar_unlocked
785 .\" rcmd
786 .\" rcmd_af
787 .\" rexec
788 .\" rexec_af
789 .\" rresvport
790 .\" rresvport_af
791 .\" ruserok
792 .\" ruserok_af
793 .\" setnetgrent
794 .\" setspent
795 .\" sgetspent
796 .\" sgetspent_r
797 .\" updwtmpx
798 .\" utmpxname
799 .\" vfscanf
800 .\" vfwscanf
801 .\" vscanf
802 .\" vsyslog
803 .\" vwscanf
804 .\"O .SS "Compiling on Linux"
805 .SS "Linux でのコンパイル"
806 .\"O On Linux, programs that use the Pthreads API should be compiled using
807 .\"O .IR "cc \-pthread" .
808 Linux では、Pthreads API を用いたプログラムは
809 .I "cc \-pthread"
810 でコンパイルすべきである。
811 .\"O .SS "Linux Implementations of POSIX Threads"
812 .SS "POSIX スレッドの Linux での実装"
813 .\"O Over time, two threading implementations have been provided by
814 .\"O the GNU C library on Linux:
815 これまで、2つのスレッドの実装が Linux の GNU C ライブラリにより
816 提供されてきた。
817 .TP
818 .B LinuxThreads
819 .\"O This is the original Pthreads implementation.
820 .\"O Since glibc 2.4, this implementation is no longer supported.
821 最初の Pthreads の実装。
822 glibc 2.4 以降は、この実装はもはやサポートされていない。
823 .TP
824 .BR NPTL " (Native POSIX Threads Library)"
825 .\"O This is the modern Pthreads implementation.
826 .\"O By comparison with LinuxThreads, NPTL provides closer conformance to
827 .\"O the requirements of the POSIX.1 specification and better performance
828 .\"O when creating large numbers of threads.
829 .\"O NPTL is available since glibc 2.3.2,
830 .\"O and requires features that are present in the Linux 2.6 kernel.
831 新しい Pthreads の実装。LinuxThreads と比べると、
832 NPTL は POSIX.1 の要求仕様への準拠の度合いが高く、
833 多数のスレッドを作成した際の性能も高い。
834 NPTL は glibc 2.3.2 以降で利用可能である。
835 NPTL を利用するには Linux 2.6 カーネルに実装されている機能が必要である。
836 .PP
837 .\"O Both of these are so-called 1:1 implementations, meaning that each
838 .\"O thread maps to a kernel scheduling entity.
839 どちらの実装もいわゆる 1:1 実装、すなわち個々のスレッドが
840 カーネルのスケジューリング実体にマッピングされる。
841 .\"O Both threading implementations employ the Linux
842 .\"O .BR clone (2)
843 .\"O system call.
844 .\"O In NPTL, thread synchronization primitives (mutexes,
845 .\"O thread joining, etc.) are implemented using the Linux
846 .\"O .BR futex (2)
847 .\"O system call.
848 どちらのスレッドの実装も Linux の
849 .BR clone (2)
850 システムコールを利用している。
851 NPTL では、スレッド同期の基本機構 (mutex や スレッドの join 等) は
852 Linux の
853 .BR futex (2)
854 システムコールを使って実装されている。
855 .SS LinuxThreads
856 .\"O The notable features of this implementation are the following:
857 この実装の大きな特徴は以下の通りである:
858 .IP \- 3
859 .\"O In addition to the main (initial) thread,
860 .\"O and the threads that the program creates using
861 .\"O .BR pthread_create (3),
862 .\"O the implementation creates a "manager" thread.
863 .\"O This thread handles thread creation and termination.
864 .\"O (Problems can result if this thread is inadvertently killed.)
865 メインスレッド (最初のスレッド) とプログラムが
866 .BR pthread_create (3)
867 を使って作成したスレッドに加え、
868 この実装では「管理 (manager)」スレッドが作成される。
869 管理スレッドはスレッドの作成と終了を取り扱う
870 (このスレッドがうっかり kill されると、問題が起こることがある)。
871 .IP \- 3
872 .\"O Signals are used internally by the implementation.
873 .\"O On Linux 2.2 and later, the first three real-time signals are used
874 .\"O (see also
875 .\"O .BR signal (7)).
876 .\"O On older Linux kernels,
877 .\"O .B SIGUSR1
878 .\"O and
879 .\"O .B SIGUSR2
880 .\"O are used.
881 .\"O Applications must avoid the use of whichever set of signals is
882 .\"O employed by the implementation.
883 この実装では内部でシグナルを使用している。
884 Linux 2.2 以降では、リアルタイムシグナルのうち最初の 3つが使われる
885 .RB ( signal (7)
886 参照)。
887 それ以前のカーネルでは
888 .B SIGUSR1
889
890 .B SIGUSR2
891 が使われる。
892 アプリケーションは、スレッド実装で利用されているシグナルを
893 どれも使わないようにしなければならない。
894 .IP \- 3
895 .\"O Threads do not share process IDs.
896 .\"O (In effect, LinuxThreads threads are implemented as processes which share
897 .\"O more information than usual, but which do not share a common process ID.)
898 .\"O LinuxThreads threads (including the manager thread)
899 .\"O are visible as separate processes using
900 .\"O .BR ps (1).
901 スレッド間でプロセス ID を共有しない
902 (実際には LinuxThreads のスレッドは通常よりは情報を共有するプロセスとして
903 実装されているが、一つの共通のプロセス ID を共有してはいない)。
904 (管理スレッドを含む) LinuxThreads スレッドは
905 .BR ps (1)
906 を使うと別のプロセスのように見える。
907 .PP
908 .\"O The LinuxThreads implementation deviates from the POSIX.1
909 .\"O specification in a number of ways, including the following:
910 LinuxThreads の実装では POSIX.1 仕様から逸脱している点が
911 いくつかある。以下に示すような点がある:
912 .IP \- 3
913 .\"O Calls to
914 .\"O .BR getpid (2)
915 .\"O return a different value in each thread.
916 .BR getpid (2)
917 を呼び出したときに、スレッド毎に異なる値が返される。
918 .IP \- 3
919 .\"O Calls to
920 .\"O .BR getppid (2)
921 .\"O in threads other than the main thread return the process ID of the
922 .\"O manager thread; instead
923 .\"O .BR getppid (2)
924 .\"O in these threads should return the same value as
925 .\"O .BR getppid (2)
926 .\"O in the main thread.
927 メインスレッド以外のスレッドで
928 .BR getppid (2)
929 を呼び出すと、管理スレッドのプロセス ID が返される。
930 本当は、これらのスレッドで
931 .BR getppid (2)
932 を呼んだ場合にはメインスレッドでの
933 .BR getppid (2)
934 と同じ値が返るべきである。
935 .IP \- 3
936 .\"O When one thread creates a new child process using
937 .\"O .BR fork (2),
938 .\"O any thread should be able to
939 .\"O .BR wait (2)
940 .\"O on the child.
941 .\"O However, the implementation only allows the thread that
942 .\"O created the child to
943 .\"O .BR wait (2)
944 .\"O on it.
945 あるスレッドが
946 .BR fork (2)
947 を使って新しい子プロセスを作成した場合、
948 どのスレッドでもこの子プロセスを
949 .BR wait (2)
950 できるべきである。しかしながら、この実装では子プロセスを作成した
951 スレッドだけがこの子プロセスを
952 .BR wait (2)
953 できる。
954 .IP \- 3
955 .\"O When a thread calls
956 .\"O .BR execve (2),
957 .\"O all other threads are terminated (as required by POSIX.1).
958 .\"O However, the resulting process has the same PID as the thread that called
959 .\"O .BR execve (2):
960 .\"O it should have the same PID as the main thread.
961 あるスレッドが
962 .BR execve (2)
963 を呼び出した場合、他のスレッドは全て終了される (POSIX.1 の仕様通り)。
964 しかしながら、新しいプロセスは
965 .BR execve (2)
966 を呼んだスレッドと同じ PID を持つ。正しくは
967 メインスレッドと同じ PID を持つべきである。
968 .IP \- 3
969 .\"O Threads do not share user and group IDs.
970 .\"O This can cause complications with set-user-ID programs and
971 .\"O can cause failures in Pthreads functions if an application
972 .\"O changes its credentials using
973 .\"O .BR seteuid (2)
974 .\"O or similar.
975 スレッド間でユーザ ID とグループ ID が共有されない
976 このことは、set-user-ID プログラムで面倒な事態を招いたり、
977 アプリケーションが
978 .BR seteuid (2)
979 などを使って信用情報 (credentials) を変更した場合に
980 Pthreads 関数が失敗する原因となる。
981 .IP \- 3
982 .\"O Threads do not share a common session ID and process group ID.
983 スレッド間で共通のセッション ID やプロセスグループ ID を共有しない。
984 .IP \- 3
985 .\"O Threads do not share record locks created using
986 .\"O .BR fcntl (2).
987 スレッド間で
988 .BR fcntl (2)
989 を使って作成されるレコード・ロックを共有しない。
990 .IP \- 3
991 .\"O The information returned by
992 .\"O .BR times (2)
993 .\"O and
994 .\"O .BR getrusage (2)
995 .\"O is per-thread rather than process-wide.
996 .BR times (2)
997
998 .BR getrusage (2)
999 が返す情報がプロセス全体の情報でなくスレッド単位の情報である。
1000 .IP \- 3
1001 .\"O Threads do not share semaphore undo values (see
1002 .\"O .BR semop (2)).
1003 スレッド間でセマフォのアンドゥ値
1004 .RB ( semop (2)
1005 参照) を共有しない。
1006 .IP \- 3
1007 .\"O Threads do not share interval timers.
1008 スレッド間でインターバル・タイマを共有しない。
1009 .IP \- 3
1010 .\"O Threads do not share a common nice value.
1011 スレッドは共通の nice 値を共有しない。
1012 .IP \- 3
1013 .\"O POSIX.1 distinguishes the notions of signals that are directed
1014 .\"O to the process as a whole and signals that are directed to individual
1015 .\"O threads.
1016 .\"O According to POSIX.1, a process-directed signal (sent using
1017 .\"O .BR kill (2),
1018 .\"O for example) should be handled by a single,
1019 .\"O arbitrarily selected thread within the process.
1020 .\"O LinuxThreads does not support the notion of process-directed signals:
1021 .\"O signals may only be sent to specific threads.
1022 POSXI.1 では、全体としてのプロセスに送られるシグナルと、
1023 個別のスレッドに送られるシグナルを区別して考えている。
1024 POSIX.1 によると、プロセスに送られたシグナル (例えば
1025 .BR kill (2)
1026 を使って送る) は、そのプロセスに属すスレッドのうち
1027 勝手に (arbitrarily) に選択された一つのスレッドにより処理される
1028 ことになっている。LinuxThreads はプロセスに送られるシグナルの
1029 概念に対応しておらず、シグナルは特定のスレッドにだけ送ることができる。
1030 .IP \- 3
1031 .\"O Threads have distinct alternate signal stack settings.
1032 .\"O However, a new thread's alternate signal stack settings
1033 .\"O are copied from the thread that created it, so that
1034 .\"O the threads initially share an alternate signal stack.
1035 .\"O (A new thread should start with no alternate signal stack defined.
1036 .\"O If two threads handle signals on their shared alternate signal
1037 .\"O stack at the same time, unpredictable program failures are
1038 .\"O likely to occur.)
1039 スレッドはそれぞれの独自の代替シグナルスタックの設定を持つ。
1040 しかし、新しいスレッドの代替シグナルスタックの設定は
1041 そのスレッドを作成したスレッドからコピーされ、そのため
1042 スレッドは最初は一つの代替シグナルスタックを共有する。
1043 (仕様では、新しいスレッドは代替シグナルスタックが定義されていない状態
1044 で開始されるべきとされている。
1045 2つのスレッドが共有されている代替シグナルスタック上で同時に
1046 シグナルの処理を行った場合、予測不可能なプログラムのエラーが
1047 起こり得る。)
1048 .SS NPTL
1049 .\"O With NPTL, all of the threads in a process are placed
1050 .\"O in the same thread group;
1051 .\"O all members of a thread group share the same PID.
1052 .\"O NPTL does not employ a manager thread.
1053 .\"O NPTL makes internal use of the first two real-time signals
1054 .\"O (see also
1055 .\"O .BR signal (7));
1056 .\"O these signals cannot be used in applications.
1057 NPTL では、一つのプロセスの全てのスレッドは同じスレッド・グループ
1058 に属する; スレッド・グループの全メンバーは同じ PID を共有する。
1059 NPTL は管理スレッド (manager thread) を利用しない。
1060 NPTL は内部でリアルタイムシグナルのうち最初の 2つの番号を使用しており
1061 .RB ( signal (7)
1062 参照)、これらのシグナルはアプリケーションでは使用できない。
1063
1064 .\"O NPTL still has at least one nonconformance with POSIX.1:
1065 NPTL にも POSIX.1 に準拠していない点が少なくとも一つある:
1066 .IP \- 3
1067 .\"O Threads do not share a common nice value.
1068 スレッドは共通の nice 値を共有しない。
1069 .\" FIXME . bug report filed for NPTL nice nonconformance
1070 .\" http://bugzilla.kernel.org/show_bug.cgi?id=6258
1071 .\" Sep 08: there is a patch by Denys Vlasenko to address this
1072 .\" "make setpriority POSIX compliant; introduce PRIO_THREAD extension"
1073 .\" Monitor this to see if it makes it into mainline.
1074 .PP
1075 .\"O Some NPTL nonconformances only occur with older kernels:
1076 NPTL の標準非準拠な点のうちいくつかは以前のカーネルでのみ発生する:
1077 .IP \- 3
1078 .\"O The information returned by
1079 .\"O .BR times (2)
1080 .\"O and
1081 .\"O .BR getrusage (2)
1082 .\"O is per-thread rather than process-wide (fixed in kernel 2.6.9).
1083 .BR times (2)
1084
1085 .BR getrusage (2)
1086 が返す情報がプロセス全体の情報でなくスレッド単位の情報である
1087 (カーネル 2.6.9 で修正された)。
1088 .IP \- 3
1089 .\"O Threads do not share resource limits (fixed in kernel 2.6.10).
1090 スレッド間でリソース制限を共有しない (カーネル 2.6.10 で修正された)。
1091 .IP \- 3
1092 .\"O Threads do not share interval timers (fixed in kernel 2.6.12).
1093 スレッド間でインターバル・タイマを共有しない
1094 (カーネル 2.6.12 で修正された)。
1095 .IP \- 3
1096 .\"O Only the main thread is permitted to start a new session using
1097 .\"O .BR setsid (2)
1098 .\"O (fixed in kernel 2.6.16).
1099 メインスレッドだけが
1100 .BR setsid (2)
1101 を使って新しいセッションを開始することができる
1102 (カーネル 2.6.16 で修正された)。
1103 .IP \- 3
1104 .\"O Only the main thread is permitted to make the process into a
1105 .\"O process group leader using
1106 .\"O .BR setpgid (2)
1107 .\"O (fixed in kernel 2.6.16).
1108 メインスレッドだけが
1109 .BR setpgid (2)
1110 を使ってそのプロセスをプロセス・グループ・リーダーにすることができる
1111 (カーネル 2.6.16 で修正された)。
1112 .IP \- 3
1113 .\"O Threads have distinct alternate signal stack settings.
1114 .\"O However, a new thread's alternate signal stack settings
1115 .\"O are copied from the thread that created it, so that
1116 .\"O the threads initially share an alternate signal stack
1117 .\"O (fixed in kernel 2.6.16).
1118 スレッドはそれぞれの独自の代替シグナルスタックの設定を持つ。
1119 しかし、新しいスレッドの代替シグナルスタックの設定は
1120 そのスレッドを作成したスレッドからコピーされ、そのため
1121 スレッドは最初は一つの代替シグナルスタックを共有する
1122 (カーネル 2.6.16 で修正された)。
1123 .PP
1124 .\"O Note the following further points about the NPTL implementation:
1125 NPTL の実装では以下の点についても注意すること:
1126 .IP \- 3
1127 .\"O If the stack size soft resource limit (see the description of
1128 .\"O .B RLIMIT_STACK
1129 .\"O in
1130 .\"O .BR setrlimit (2))
1131 .\"O is set to a value other than
1132 .\"O .IR unlimited ,
1133 .\"O then this value defines the default stack size for new threads.
1134 .\"O To be effective, this limit must be set before the program
1135 .\"O is executed, perhaps using the
1136 .\"O .I ulimit -s
1137 .\"O shell built-in command
1138 .\"O .RI ( "limit stacksize"
1139 .\"O in the C shell).
1140 スタックサイズのリソースのソフト・リミット
1141 .RB ( setrlimit (2)
1142
1143 .B RLIMIT_STACK
1144 の説明を参照) が
1145 .I unlimited
1146 以外の値に設定されている場合、ソフト・リミットの値が
1147 新しいスレッドのデフォルトのスタックサイズとなる。
1148 設定を有効にするためには、プログラムを実行する前にリミット値を
1149 設定しておかなければならない。たいていは、シェルの組み込みコマンドの
1150 .I ulimit -s
1151 (C シェルでは
1152 .IR "limit stacksize" )
1153 を使って設定する。
1154 .\"O .SS "Determining the Threading Implementation"
1155 .SS "スレッド実装の判定"
1156 .\"O Since glibc 2.3.2, the
1157 .\"O .BR getconf (1)
1158 .\"O command can be used to determine
1159 .\"O the system's threading implementation, for example:
1160 glibc 2.3.2 以降では、
1161 .BR getconf (1)
1162 コマンドを使って、
1163 システムのスレッド実装を判定することができる。
1164 以下に例を示す:
1165 .nf
1166 .in +4n
1167
1168 bash$ getconf GNU_LIBPTHREAD_VERSION
1169 NPTL 2.3.4
1170 .in
1171 .fi
1172 .PP
1173 .\"O With older glibc versions, a command such as the following should
1174 .\"O be sufficient to determine the default threading implementation:
1175 ぞれ以前の glibc のバージョンでは、以下のようなコマンドで
1176 デフォルトのスレッド実装を判定することができる。
1177 .nf
1178 .in +4n
1179
1180 bash$ $( ldd /bin/ls | grep libc.so | awk \(aq{print $3}\(aq ) | \\
1181                 egrep \-i \(aqthreads|ntpl\(aq
1182         Native POSIX Threads Library by Ulrich Drepper et al
1183 .in
1184 .fi
1185 .\"O .SS "Selecting the Threading Implementation: LD_ASSUME_KERNEL"
1186 .SS "スレッドの実装の選択: LD_ASSUME_KERNEL"
1187 .\"O On systems with a glibc that supports both LinuxThreads and NPTL
1188 .\"O (i.e., glibc 2.3.\fIx\fP), the
1189 .\"O .B LD_ASSUME_KERNEL
1190 .\"O environment variable can be used to override
1191 .\"O the dynamic linker's default choice of threading implementation.
1192 .\"O This variable tells the dynamic linker to assume that it is
1193 .\"O running on top of a particular kernel version.
1194 LinuxThreads と NPTL の両方をサポートしている glibc
1195 (glibc 2.3.\fIx\fP) があるシステムでは、
1196 .B LD_ASSUME_KERNEL
1197 環境変数を使うことで、動的リンカがデフォルトで
1198 選択するスレッド実装を上書きすることができる。
1199 この変数により、動的リンカが特定のバージョンのカーネル上で
1200 動作していると仮定するように指定する。
1201 .\"O By specifying a kernel version that does not
1202 .\"O provide the support required by NPTL, we can force the use
1203 .\"O of LinuxThreads.
1204 .\"O (The most likely reason for doing this is to run a
1205 .\"O (broken) application that depends on some nonconformant behavior
1206 .\"O in LinuxThreads.)
1207 .\"O For example:
1208 NPTL が必要とするサポート機能を提供していないカーネルバージョンを
1209 指定することで、強制的に LinuxThreads を使うことができる
1210 (このようなことをする最もありそうな場面は、
1211 LinuxThreads の標準非準拠な振舞いに依存する (壊れた) アプリケーション
1212 を動作させる場合だろう)。
1213 以下に例を示す:
1214 .nf
1215 .in +4n
1216
1217 bash$ $( LD_ASSUME_KERNEL=2.2.5 ldd /bin/ls | grep libc.so | \\
1218                 awk \(aq{print $3}\(aq ) | egrep \-i \(aqthreads|ntpl\(aq
1219         linuxthreads-0.10 by Xavier Leroy
1220 .in
1221 .fi
1222 .\"O .SH "SEE ALSO"
1223 .SH 関連項目
1224 .BR clone (2),
1225 .BR futex (2),
1226 .BR gettid (2),
1227 .BR futex (7),
1228 .BR sigevent (7),
1229 .BR signal (7),
1230 .br
1231 .\"O and various Pthreads manual pages, for example:
1232 および Pthreads の各種マニュアルページ、例えば:
1233 .BR pthread_attr_init (3),
1234 .BR pthread_atfork (3),
1235 .BR pthread_cancel (3),
1236 .BR pthread_cleanup_push (3),
1237 .BR pthread_cond_signal (3),
1238 .BR pthread_cond_wait (3),
1239 .BR pthread_create (3),
1240 .BR pthread_detach (3),
1241 .BR pthread_equal (3),
1242 .BR pthread_exit (3),
1243 .BR pthread_key_create (3),
1244 .BR pthread_kill (3),
1245 .BR pthread_mutex_lock (3),
1246 .BR pthread_mutex_unlock (3),
1247 .BR pthread_once (3),
1248 .BR pthread_setcancelstate (3),
1249 .BR pthread_setcanceltype (3),
1250 .BR pthread_setspecific (3),
1251 .BR pthread_sigmask (3),
1252 .\"O and
1253 .BR pthread_testcancel (3)