doc/ja_JP.eucJP/man/man3/pthread.3
Kazuo Horikawa 6a00dc5ed2 man3 update to 4.5-RELEASE base done by jpman project <man-jp@jp.FreeBSD.org>
Submitted by:	Yuko Sasaki <yuko@veltec.co.jp>
2002-05-18 07:12:57 +00:00

454 lines
12 KiB
Groff
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

.\" Copyright (c) 1996 John Birrell <jb@cimlogic.com.au>.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by John Birrell.
.\" 4. Neither the name of the author nor the names of any co-contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY JOHN BIRRELL AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" %FreeBSD: src/share/man/man3/pthread.3,v 1.12.2.4 2001/08/17 13:08:36 ru Exp %
.\" %FreeBSD: src/share/man/man3/pthread.3,v 1.12.2.5 2001/12/17 11:30:11 ru Exp %
.\"
.\" $FreeBSD$
.Dd September 10, 1998
.Dt PTHREAD 3
.Os
.Sh ̾¾Î
.Nm pthread
.Nd POSIX ¥¹¥ì¥Ã¥É´Ø¿ô
.Sh ½ñ¼°
.In pthread.h
.Sh ²òÀâ
POSIX ¥¹¥ì¥Ã¥É¤Ï¡¢¥×¥í¥»¥¹Æâ¤Ç¥¹¥ì¥Ã¥É (thread) ¤È¸Æ¤Ð¤ì¤ë
À©¸æ¤ÎÊ£¿ô¤Î¥Õ¥í¡¼¤òÍ׵᤹¤ë¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤ò¥µ¥Ý¡¼¥È¤¹¤ë´Ø¿ô·²¤Ç¤¹¡£
¥Þ¥ë¥Á¥¹¥ì¥Ã¥É¤Ï¡¢¥×¥í¥°¥é¥à¤Î¥Ñ¥Õ¥©¡¼¥Þ¥ó¥¹¤ò²þÁ±¤¹¤ë¤¿¤á¤Ë»ÈÍѤµ¤ì¤Þ¤¹¡£
.Pp
¤³¤Î¥»¥¯¥·¥ç¥ó¤Ç¤Ï¡¢
POSIX ¥¹¥ì¥Ã¥É´Ø¿ô¤Î³µÍפˤĤ¤¤Æ°Ê²¼¤Î¥°¥ë¡¼¥×¤Ëʬ¤±¤ÆÀâÌÀ¤·¤Þ¤¹¡£
.Bl -bullet -offset indent
.It
¥¹¥ì¥Ã¥É¥ë¡¼¥Á¥ó
.It
°À­¥ª¥Ö¥¸¥§¥¯¥È¥ë¡¼¥Á¥ó
.It
mutex ¥ë¡¼¥Á¥ó
.It
¾ò·ïÊÑ¿ô¥ë¡¼¥Á¥ó
.It
ÆÉ¼è¤ê / ½ñ¹þ¤ß¥í¥Ã¥¯¥ë¡¼¥Á¥ó
.It
¥¹¥ì¥Ã¥É¸ÇÍ­¥³¥ó¥Æ¥­¥¹¥È¥ë¡¼¥Á¥ó
.It
¥¯¥ê¡¼¥ó¥¢¥Ã¥×¥ë¡¼¥Á¥ó
.El
.Sh ¥¹¥ì¥Ã¥É¥ë¡¼¥Á¥ó
.Bl -tag -width Er
.It Xo
.Ft int
.Fn pthread_create "pthread_t *thread" "const pthread_attr_t *attr" "void *(*start_routine)(void *)" "void *arg"
.Xc
¿·¤·¤¤¼Â¹Ô¤¹¤ë¥¹¥ì¥Ã¥É¤òºîÀ®¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_detach "pthread_t thread"
.Xc
¥¹¥ì¥Ã¥É¤Ëºï½ü¤Î¤¿¤á¤Î°õ¤òÉÕ¤±¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_equal "pthread_t t1" "pthread_t t2"
.Xc
2 ¤Ä¤Î¥¹¥ì¥Ã¥É¤Î ID ¤òÈæ³Ó¤·¤Þ¤¹¡£
.It Xo
.Ft void
.Fn pthread_exit "void *value_ptr"
.Xc
¸Æ¤Ó½Ð¤·¤Æ¤¤¤ë¥¹¥ì¥Ã¥É¤ò½ªÎ»¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_join "pthread_t thread" "void **value_ptr"
.Xc
¸Æ¤Ó½Ð¤·¤Æ¤¤¤ë¥¹¥ì¥Ã¥É¤¬¡¢»ØÄꤷ¤¿¥¹¥ì¥Ã¥É¤Î½ªÎ»¤òÂԤĤ褦¤Ë¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_cancel "pthread_t thread"
.Xc
¥¹¥ì¥Ã¥É¤Î¼Â¹Ô¤ò¼è¤ê¾Ã¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_once "pthread_once_t *once_control" "void (*init_routine)(void)"
.Xc
½é´ü²½¥ë¡¼¥Á¥ó¤ò°ìÅÙ¤À¤±¸Æ¤Ó½Ð¤·¤Þ¤¹¡£
.It Xo
.Ft pthread_t
.Fn pthread_self void
.Xc
¸Æ¤Ó½Ð¤·¤Æ¤¤¤ë¥¹¥ì¥Ã¥É¤Î ID ¤òÊÖ¤·¤Þ¤¹¡£
.El
.Sh °À­¥ª¥Ö¥¸¥§¥¯¥È¥ë¡¼¥Á¥ó
.Bl -tag -width Er
.It Xo
.Ft int
.Fn pthread_attr_destroy "pthread_attr_t *attr"
.Xc
¥¹¥ì¥Ã¥É¤Î°À­¥ª¥Ö¥¸¥§¥¯¥È¤òÇ˲õ¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_attr_getinheritsched "const pthread_attr_t *attr" "int *inheritsched"
.Xc
¥¹¥ì¥Ã¥É¤Î°À­¥ª¥Ö¥¸¥§¥¯¥È¤«¤é·Ñ¾µ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°Â°À­¤ò¼èÆÀ¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_attr_getschedparam "const pthread_attr_t *attr" "struct sched_param *param"
.Xc
¥¹¥ì¥Ã¥É¤Î°À­¥ª¥Ö¥¸¥§¥¯¥È¤«¤é¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥Ñ¥é¥á¡¼¥¿Â°À­¤ò¼èÆÀ¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_attr_getschedpolicy "const pthread_attr_t *attr" "int *policy"
.Xc
¥¹¥ì¥Ã¥É¤Î°À­¥ª¥Ö¥¸¥§¥¯¥È¤«¤é¥¹¥±¥¸¥å¡¼¥ê¥ó¥°Êý¿Ë°À­¤ò¼èÆÀ¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_attr_getscope "const pthread_attr_t *attr" "int *contentionscope"
.Xc
¥¹¥ì¥Ã¥É¤Î°À­¥ª¥Ö¥¸¥§¥¯¥È¤«¤é¥³¥ó¥Æ¥ó¥·¥ç¥óÈϰϰÀ­¤ò¼èÆÀ¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_attr_getstacksize "const pthread_attr_t *attr" "size_t *stacksize"
.Xc
¥¹¥ì¥Ã¥É¤Î°À­¥ª¥Ö¥¸¥§¥¯¥È¤«¤é¥¹¥¿¥Ã¥¯¥µ¥¤¥ºÂ°À­¤ò¼èÆÀ¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_attr_getstackaddr "const pthread_attr_t *attr" "void **stackaddr"
.Xc
¥¹¥ì¥Ã¥É¤Î°À­¥ª¥Ö¥¸¥§¥¯¥È¤«¤é¥¹¥¿¥Ã¥¯¥¢¥É¥ì¥¹Â°À­¤ò¼èÆÀ¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_attr_getdetachstate "const pthread_attr_t *attr" "int *detachstate"
.Xc
¥¹¥ì¥Ã¥É¤Î°À­¥ª¥Ö¥¸¥§¥¯¥È¤«¤é¥Ç¥¿¥Ã¥Á¾õÂÖ°À­¤ò¼èÆÀ¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_attr_init "pthread_attr_t *attr"
.Xc
¥¹¥ì¥Ã¥É°À­¥ª¥Ö¥¸¥§¥¯¥È¤ò¥Ç¥Õ¥©¥ë¥ÈÃͤǽé´ü²½¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_attr_setinheritsched "pthread_attr_t *attr" "int inheritsched"
.Xc
¥¹¥ì¥Ã¥É¤Î°À­¥ª¥Ö¥¸¥§¥¯¥È¤Ë·Ñ¾µ¥¹¥±¥¸¥å¡¼¥ê¥ó¥°Â°À­¤òÀßÄꤷ¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_attr_setschedparam "pthread_attr_t *attr" "const struct sched_param *param"
.Xc
¥¹¥ì¥Ã¥É¤Î°À­¥ª¥Ö¥¸¥§¥¯¥È¤Ë¥¹¥±¥¸¥å¡¼¥ê¥ó¥°¥Ñ¥é¥á¡¼¥¿Â°À­¤òÀßÄꤷ¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_attr_setschedpolicy "pthread_attr_t *attr" "int policy"
.Xc
¥¹¥ì¥Ã¥É¤Î°À­¥ª¥Ö¥¸¥§¥¯¥È¤Ë¥¹¥±¥¸¥å¡¼¥ê¥ó¥°Êý¿Ë°À­¤òÀßÄꤷ¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_attr_setscope "pthread_attr_t *attr" "int contentionscope"
.Xc
¥¹¥ì¥Ã¥É¤Î°À­¥ª¥Ö¥¸¥§¥¯¥È¤Ë¥³¥ó¥Æ¥ó¥·¥ç¥óÈϰϰÀ­¤òÀßÄꤷ¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_attr_setstacksize "pthread_attr_t *attr" "size_t stacksize"
.Xc
¥¹¥ì¥Ã¥É¤Î°À­¥ª¥Ö¥¸¥§¥¯¥È¤Ë¥¹¥¿¥Ã¥¯¥µ¥¤¥ºÂ°À­¤òÀßÄꤷ¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_attr_setstackaddr "pthread_attr_t *attr" "void *stackaddr"
.Xc
¥¹¥ì¥Ã¥É¤Î°À­¥ª¥Ö¥¸¥§¥¯¥È¤Ë¥¹¥¿¥Ã¥¯¥¢¥É¥ì¥¹Â°À­¤òÀßÄꤷ¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_attr_setdetachstate "pthread_attr_t *attr" "int detachstate"
.Xc
¥¹¥ì¥Ã¥É¤Î°À­¥ª¥Ö¥¸¥§¥¯¥È¤Ë¥Ç¥¿¥Ã¥Á¾õÂÖ°À­¤òÀßÄꤷ¤Þ¤¹¡£
.El
.Sh mutex ¥ë¡¼¥Á¥ó
.Bl -tag -width Er
.It Xo
.Ft int
.Fn pthread_mutexattr_destroy "pthread_mutexattr_t *attr"
.Xc
mutex ¤Î°À­¥ª¥Ö¥¸¥§¥¯¥È¤òÇ˲õ¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_mutexattr_init "pthread_mutexattr_t *attr"
.Xc
mutex ¤Î°À­¥ª¥Ö¥¸¥§¥¯¥È¤ò¥Ç¥Õ¥©¥ë¥ÈÃͤǽé´ü²½¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_mutex_destroy "pthread_mutex_t *mutex"
.Xc
mutex ¤òÇ˲õ¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_mutex_init "pthread_mutex_t *mutex" "const pthread_mutexattr_t *attr"
.Xc
mutex ¤ò»ØÄꤵ¤ì¤¿Â°À­¤Ç½é´ü²½¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_mutex_lock "pthread_mutex_t *mutex"
.Xc
mutex ¤ò¥í¥Ã¥¯¤·¤Æ¡¢mutex ¤¬ÍøÍѲÄǽ¤Ë¤Ê¤ë¤Þ¤Ç¥Ö¥í¥Ã¥¯¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_mutex_trylock "pthread_mutex_t *mutex"
.Xc
mutex ¤ò¥í¥Ã¥¯¤·¤è¤¦¤È¤·¤Þ¤¹¤¬¡¢mutex ¤¬¸½ºß¤Î¥¹¥ì¥Ã¥É¤ò´Þ¤á¤¿
Ê̤Υ¹¥ì¥Ã¥É¤Ë¤è¤Ã¤Æ¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë¾ì¹ç¤Ë¤Ï¡¢¥Ö¥í¥Ã¥¯¤·¤Þ¤»¤ó¡£
.It Xo
.Ft int
.Fn pthread_mutex_unlock "pthread_mutex_t *mutex"
.Xc
mutex ¤Î¥í¥Ã¥¯¤ò²ò½ü¤·¤Þ¤¹¡£
.El
.Sh ¾ò·ïÊÑ¿ô¥ë¡¼¥Á¥ó
.Bl -tag -width Er
.It Xo
.Ft int
.Fn pthread_condattr_init "pthread_condattr_t *attr"
.Xc
¾ò·ïÊÑ¿ô¤Î°À­¥ª¥Ö¥¸¥§¥¯¥È¤ò¥Ç¥Õ¥©¥ë¥ÈÃͤǽé´ü²½¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_condattr_destroy "pthread_condattr_t *attr"
.Xc
¾ò·ïÊÑ¿ô¤Î°À­¥ª¥Ö¥¸¥§¥¯¥È¤òÇ˲õ¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_cond_broadcast "pthread_cond_t *cond"
.Xc
»ØÄꤵ¤ì¤¿¾ò·ïÊÑ¿ô¤Ç¸½ºß¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë
Á´¤Æ¤Î¥¹¥ì¥Ã¥É¤Î¥Ö¥í¥Ã¥¯¤ò²ò½ü¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_cond_destroy "pthread_cond_t *cond"
.Xc
¾ò·ïÊÑ¿ô¤òÇ˲õ¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_cond_init "pthread_cond_t *cond" "const pthread_condattr_t *attr"
.Xc
¾ò·ïÊÑ¿ô¤ò»ØÄꤵ¤ì¤¿Â°À­¤Ç½é´ü²½¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_cond_signal "pthread_cond_t *cond"
.Xc
»ØÄꤵ¤ì¤¿¾ò·ïÊÑ¿ô¤Ç¸½ºß¥Ö¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤ë
¾¯¤Ê¤¯¤È¤â 1 ¤Ä¤Î¥¹¥ì¥Ã¥É¤Î¥Ö¥í¥Ã¥¯¤ò²ò½ü¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_cond_timedwait "pthread_cond_t *cond" "pthread_mutex_t *mutex" "const struct timespec *abstime"
.Xc
¾ò·ï¤ò»ØÄꤵ¤ì¤¿»þ´ÖÆâ¤ÇÂÔµ¡¤·¡¢»ØÄꤵ¤ì¤¿ mutex ¤ò¥í¥Ã¥¯¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_cond_wait "pthread_cond_t *" "pthread_mutex_t *mutex"
.Xc
¾ò·ï¤òÂÔµ¡¤·¡¢»ØÄꤵ¤ì¤¿ mutex ¤ò¥í¥Ã¥¯¤·¤Þ¤¹¡£
.El
.Sh ÆÉ¼è¤ê / ½ñ¹þ¤ß¥í¥Ã¥¯¥ë¡¼¥Á¥ó
.Bl -tag -width Er
.It Xo
.Ft int
.Fn pthread_rwlock_destroy "pthread_rwlock_t *lock"
.Xc
ÆÉ¼è¤ê / ½ñ¹þ¤ß¥í¥Ã¥¯¥ª¥Ö¥¸¥§¥¯¥È¤òÇ˲õ¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_rwlock_init "pthread_rwlock_t *lock" "const pthread_rwlockattr_t *attr"
.Xc
ÆÉ¼è¤ê / ½ñ¹þ¤ß¥í¥Ã¥¯¥ª¥Ö¥¸¥§¥¯¥È¤ò½é´ü²½¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_rwlock_rdlock "pthread_rwlock_t *lock"
.Xc
ÆÉ¼è¤ê / ½ñ¹þ¤ß¥í¥Ã¥¯¤òÆÉ¼è¤êÍѤ˥í¥Ã¥¯¤·¡¢
¥í¥Ã¥¯¤ò¼èÆÀ¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¤Þ¤Ç¥Ö¥í¥Ã¥¯¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_rwlock_tryrdlock "pthread_rwlock_t *lock"
.Xc
ÆÉ¼è¤ê / ½ñ¹þ¤ß¥í¥Ã¥¯¤òÆÉ¼è¤êÍѤ˥í¥Ã¥¯¤·¤è¤¦¤È¤·¤Þ¤¹¤¬¡¢
¥í¥Ã¥¯¤Ç¤­¤Ê¤¤¾ì¹ç¤Ë¤Ï¥Ö¥í¥Ã¥¯¤·¤Þ¤»¤ó¡£
.It Xo
.Ft int
.Fn pthread_rwlock_trywrlock "pthread_rwlock_t *lock"
.Xc
ÆÉ¼è¤ê / ½ñ¹þ¤ß¥í¥Ã¥¯¤ò½ñ¹þ¤ßÍѤ˥í¥Ã¥¯¤·¤è¤¦¤È¤·¤Þ¤¹¤¬¡¢
¥í¥Ã¥¯¤Ç¤­¤Ê¤¤¾ì¹ç¤Ë¤Ï¥Ö¥í¥Ã¥¯¤·¤Þ¤»¤ó¡£
.It Xo
.Ft int
.Fn pthread_rwlock_unlock "pthread_rwlock_t *lock"
.Xc
ÆÉ¼è¤ê / ½ñ¹þ¤ß¥í¥Ã¥¯¤Î¥í¥Ã¥¯¤ò²ò½ü¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_rwlock_wrlock "pthread_rwlock_t *lock"
.Xc
ÆÉ¼è¤ê / ½ñ¹þ¤ß¥í¥Ã¥¯¤ò½ñ¹þ¤ßÍѤ˥í¥Ã¥¯¤·¡¢
¥í¥Ã¥¯¤ò¼èÆÀ¤Ç¤­¤ë¤è¤¦¤Ë¤Ê¤ë¤Þ¤Ç¥Ö¥í¥Ã¥¯¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_rwlockattr_destroy "pthread_rwlockattr_t *attr"
.Xc
ÆÉ¼è¤ê / ½ñ¹þ¤ß¥í¥Ã¥¯¤Î°À­¥ª¥Ö¥¸¥§¥¯¥È¤òÇ˲õ¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_rwlockattr_getpshared "const pthread_rwlockattr_t *attr" "int *pshared"
.Xc
ÆÉ¼è¤ê / ½ñ¹þ¤ß¥í¥Ã¥¯¤Î°À­¥ª¥Ö¥¸¥§¥¯¥È¤Î¥×¥í¥»¥¹¶¦Í­ÀßÄê¤ò¼èÆÀ¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_rwlockattr_init "pthread_rwlockattr_t *attr"
.Xc
ÆÉ¼è¤ê / ½ñ¹þ¤ß¥í¥Ã¥¯¤Î°À­¥ª¥Ö¥¸¥§¥¯¥È¤ò½é´ü²½¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_rwlockattr_setpshared "pthread_rwlockattr_t *attr" "int pshared"
.Xc
ÆÉ¼è¤ê / ½ñ¹þ¤ß¥í¥Ã¥¯¤Î°À­¥ª¥Ö¥¸¥§¥¯¥È¤Î¥×¥í¥»¥¹¶¦Í­ÀßÄê¤òÀßÄꤷ¤Þ¤¹¡£
.El
.Sh ¥¹¥ì¥Ã¥É¸ÇÍ­¥³¥ó¥Æ¥­¥¹¥È¥ë¡¼¥Á¥ó
.Bl -tag -width Er
.It Xo
.Ft int
.Fn pthread_key_create "pthread_key_t *key" "void (*routine)(void *)"
.Xc
¥¹¥ì¥Ã¥É¸ÇÍ­¤Î¥Ç¡¼¥¿¥­¡¼¤òºîÀ®¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_key_delete "pthread_key_t key"
.Xc
¥¹¥ì¥Ã¥É¸ÇÍ­¤Î¥Ç¡¼¥¿¥­¡¼¤òºï½ü¤·¤Þ¤¹¡£
.It Xo
.Ft "void *"
.Fn pthread_getspecific "pthread_key_t key"
.Xc
»ØÄꤵ¤ì¤¿¥­¡¼¤Î¥¹¥ì¥Ã¥É¸ÇÍ­¤ÎÃͤò¼èÆÀ¤·¤Þ¤¹¡£
.It Xo
.Ft int
.Fn pthread_setspecific "pthread_key_t key" "const void *value_ptr"
.Xc
»ØÄꤵ¤ì¤¿¥­¡¼¤Î¥¹¥ì¥Ã¥É¸ÇÍ­¤ÎÃͤòÀßÄꤷ¤Þ¤¹¡£
.El
.Sh ¥¯¥ê¡¼¥ó¥¢¥Ã¥×¥ë¡¼¥Á¥ó
.Bl -tag -width Er
.It Xo
.Ft void
.Fn pthread_cleanup_pop "int execute"
.Xc
¸Æ¤Ó½Ð¤·¤Æ¤¤¤ë¥¹¥ì¥Ã¥É¤Î¼è¤ê¾Ã¤·¥¯¥ê¡¼¥ó¥¢¥Ã¥×¥¹¥¿¥Ã¥¯¤ÎºÇ½é¤Î¥ë¡¼¥Á¥ó¤ò
ºï½ü¤·¡¢¥ª¥×¥·¥ç¥ó¤Ç¤½¤Î¥ë¡¼¥Á¥ó¤ò¼Â¹Ô¤·¤Þ¤¹¡£
.It Xo
.Ft void
.Fn pthread_cleanup_push "void (*routine)(void *)" "void *routine_arg"
.Xc
¸Æ¤Ó½Ð¤·¤Æ¤¤¤ë¥¹¥ì¥Ã¥É¤Î¼è¤ê¾Ã¤·¥¹¥¿¥Ã¥¯¤Ë»ØÄꤵ¤ì¤¿¼è¤ê¾Ã¤·¥¯¥ê¡¼¥ó¥¢¥Ã¥×
¥Ï¥ó¥É¥é¤òÀѤߤޤ¹¡£
.El
.Sh ¥¤¥ó¥¹¥È¥ì¡¼¥·¥ç¥ó
¸½ºß¤Î
.Fx
POSIX ¥¹¥ì¥Ã¥É¤Î¼ÂÁõ¤Ï¡¢¥¹¥ì¥Ã¥É¥»¡¼¥Õ¤Ê libc ´Ø¿ô¤È¥¹¥ì¥Ã¥É´Ø¿ô¤ò´Þ¤à
¥é¥¤¥Ö¥é¥ê
.Fa libc_r
¤Ç¹½ÃÛ¤µ¤ì¤Æ¤¤¤Þ¤¹¡£¤³¤Î¥é¥¤¥Ö¥é¥ê¤Ï¥¹¥ì¥Ã¥É¥¢¥×¥ê¥±¡¼¥·¥ç¥ó¤Î
.Fa libc
¤òÃÖ¤­´¹¤¨¤Þ¤¹¡£
.Pp
¥Ç¥Õ¥©¥ë¥È¤Ç¤Ï¡¢
.Fa libc_r
¤Ï 'make world' ¤Î°ìÉô¤È¤·¤Æ¹½ÃÛ¤µ¤ì¤Þ¤¹¡£¤³¤Î¹½ÃÛ¤ò̵¸ú¤Ë¤¹¤ë¤Ë¤Ï¡¢
.Xr make 1
¤Ë '-DNOLIBC_R' ¥ª¥×¥·¥ç¥ó¤òÍ¿¤¨¤Ê¤±¤ì¤Ð¤Ê¤ê¤Þ¤»¤ó¡£
.Pp
¥¹¥ì¥Ã¥É²½¤µ¤ì¤¿¥×¥í¥»¥¹¤ò´Êñ¤Ë¥ê¥ó¥¯¤¹¤ë¤¿¤á¤Ë¡¢gcc ¤Ë
.Fx
¸ÇÍ­¤Î¥ª¥×¥·¥ç¥ó¤¬Äɲäµ¤ì¤Æ¤¤¤Þ¤¹¡£
.Fa gcc -pthread
¤Ï¥¹¥ì¥Ã¥É²½¤µ¤ì¤¿¥×¥í¥»¥¹¤Ë
.Fa libc
¤ËÂå¤Ã¤Æ
.Fa libc_r
¤ò¥ê¥ó¥¯¤·¤Þ¤¹¡£
.Sh ´ØÏ¢¹àÌÜ
.Xr pthread_create 3 ,
.Xr pthread_detach 3 ,
.Xr pthread_equal 3 ,
.Xr pthread_exit 3 ,
.Xr pthread_join 3 ,
.Xr pthread_once 3 ,
.Xr pthread_self 3 ,
.Xr pthread_mutex_destroy 3 ,
.Xr pthread_mutex_init 3 ,
.Xr pthread_mutex_lock 3 ,
.Xr pthread_mutex_trylock 3 ,
.Xr pthread_mutex_unlock 3 ,
.Xr pthread_cond_broadcast 3 ,
.Xr pthread_cond_destroy 3 ,
.Xr pthread_cond_init 3 ,
.Xr pthread_cond_signal 3 ,
.Xr pthread_cond_timedwait 3 ,
.Xr pthread_cond_wait 3 ,
.Xr pthread_rwlock_destroy 3 ,
.Xr pthread_rwlock_init 3 ,
.Xr pthread_rwlock_rdlock 3 ,
.Xr pthread_rwlock_unlock 3 ,
.Xr pthread_rwlock_wrlock 3 ,
.Xr pthread_rwlockattr_destroy 3 ,
.Xr pthread_rwlockattr_getpshared 3 ,
.Xr pthread_rwlockattr_init 3 ,
.Xr pthread_rwlockattr_setpshared 3 ,
.Xr pthread_key_delete 3 ,
.Xr pthread_getspecific 3 ,
.Xr pthread_setspecific 3 ,
.Xr pthread_cleanup_pop 3 ,
.Xr pthread_cleanup_push 3
.Sh µ¬³Ê
.Fa pthread_
ÀÜÆ¬¸ì¤¬ÉÕ¤­¡¢
.Fa _np
ÀÜÈø¸ì¤Þ¤¿¤Ï
.Fa pthread_rwlock
ÀÜÆ¬¸ì¤¬ÉÕ¤¤¤Æ¤¤¤Ê¤¤
.Fa libc_r
¤Î´Ø¿ô¤Ï¡¢
.St -p1003.1-96
¤ËŬ¹ç¤·¤Æ¤¤¤Þ¤¹¡£
.Pp
.Fa pthread_
ÀÜÆ¬¸ì¤ª¤è¤Ó
.Fa _np
ÀÜÈø¸ì¤¬ÉÕ¤¤¤¿ libc_r ¤Î´Ø¿ô¤Ï¡¢POSIX ¥¹¥ì¥Ã¥É¤Ø¤ÎÈó¥Ý¡¼¥¿¥Ö¥ë³ÈÄ¥¤Ç¤¹¡£
.Pp
.Fa pthread_rwlock
ÀÜÆ¬¸ì¤¬ÉÕ¤¤¤¿ libc_r ¤Î´Ø¿ô¤Ï¡¢
.St -susv2
¤Î The Open Group ¤Ë¤è¤Ã¤ÆºîÀ®¤µ¤ì¤¿³ÈÄ¥¤Ç¤¹¡£