.\" Copyright (c) 1997 Brian Cully .\" 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. 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/lib/libc_r/man/pthread_mutex_init. 3, v 1.6. 2.5 2001/12/17 10:08:26 ru Exp % .\" .\" $FreeBSD: doc/ja_JP.eucJP/man/man3/pthread_mutex_init. 3, v 1.5 2002/05/18 07:12:56 horikawa Exp $ .Dd July 29, 1998 .Dt PTHREAD_MUTEX_INIT 3 .Os .Sh ¸íĪ .Nm pthread_mutex_init .Nd mutex ÀÇ ÀÛ¼º .Sh ÇÁ·Î±×·¥ ¶óÀ̺귯¸® .Lb libc_r .Sh ¼­½Ä .In pthread.h .Ft int .Fn pthread_mutex_init "pthread_mutex_t *mutex" "const pthread_mutexattr_t *attr" .Sh ÇØ¼³ .Fn pthread_mutex_init ÇÔ¼ö´Â, .Fa attr (À¸)·Î ÁöÁ¤µÈ ¼Ó¼ºÀ¸·Î »õ·Î¿î mutex ¸¦ ÀÛ¼ºÇÕ´Ï´Ù. .Fa attr ÇÏÁö¸¸ NULL ÀÇ °æ¿ì¿¡´Â, µðÆúÆ®ÀÇ ¼Ó¼ºÀÌ »ç¿ëµË´Ï´Ù. .Sh ¹Ýȯ°ª ¹®Á¦°¡ ¾ø´Â °æ¿ì´Â, .Fn pthread_mutex_init (Àº)´Â 0 À» µ¹·ÁÁÖ¾î, .Fa mutex ¿¡ »õ·Î¿î mutex ÀÇ ID ¸¦ ³Ö½À´Ï´Ù. ¹®Á¦°¡ ÀÖ´Â °æ¿ì´Â, ±× ¿¡·¯¸¦ ³ªÅ¸³»±â À§Çؼ­(¶§¹®¿¡) ¿¡·¯ ¹øÈ£°¡ µ¹·ÁÁÖ¾îÁý´Ï´Ù. .Sh ¿¡·¯ .Fn pthread_mutex_init (Àº)´Â ÀÌÇÏÀÇ °æ¿ì¿¡ ½ÇÆÐÇÕ´Ï´Ù. .Bl -tag -width Er .It Bq Er EINVAL .Fa attr ¿¡ ÀÇÇØ ÁöÁ¤µÈ °ªÀÌ ¹«È¿ÀÔ´Ï´Ù. .It Bq Er ENOMEM ÇÁ·Î¼¼½º°¡ ´Ù¸¥ mutex ÀÇ ÀÛ¼ºÀ» À§ÇÑ ÃæºÐÇÑ ¸Þ¸ð¸®¸¦ ÇÒ´çÇÒ ¼ö ¾ø½À´Ï´Ù. .It Bq Er EAGAIN ´Ù¸¥ mutex ¸¦ ÀÛ¼ºÇϱâ À§Çؼ­ ÀϽÃÀûÀÎ ¸®¼Ò½º°¡ ºÎÁ·ÇÕ´Ï´Ù. .El .Sh °ü·Ã Ç׸ñ .Xr pthread_mutex_destroy 3 , .Xr pthread_mutex_lock 3 , .Xr pthread_mutex_trylock 3 , .Xr pthread_mutex_unlock 3 .Sh Ç¥ÁØ .Fn pthread_mutex_init ÇÏ .St -p1003.1-96 ¿¡ ÀûÇÕÇϰí ÀÖ½À´Ï´Ù.