.\" Copyright (c) 1996-1998 John Birrell . .\" 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/lib/libc_r/man/pthread_join. 3, v 1.7. 2.5 2001/12/17 10:08:26 ru Exp % .\" .\" $FreeBSD: doc/ja_JP.eucJP/man/man3/pthread_join. 3, v 1.5 2002/05/18 07:12:56 horikawa Exp $ .Dd April 4, 1996 .Dt PTHREAD_JOIN 3 .Os .Sh ¸íĪ .Nm pthread_join .Nd thread Á¾·áÀÇ ´ë±â .Sh ÇÁ·Î±×·¥ ¶óÀ̺귯¸® .Lb libc_r .Sh ¼­½Ä .In pthread.h .Ft int .Fn pthread_join "pthread_t thread" "void **value_ptr" .Sh ÇØ¼³ .Fn pthread_join ÇÔ¼ö´Â, ´ë»ó .Fa thread ÇÏÁö¸¸ ¾ÆÁ÷ Á¾·áÇϰí ÀÖÁö ¾Ê´Â °æ¿ì¿¡´Â, ±× ´ë»ó .Fa thread (ÀÌ)°¡ Á¾·áµÉ ¶§±îÁö, È£ÃâÇϰí ÀÖ´Â threadÀÇ ½ÇÇàÀ» º¸·ùÇÕ´Ï´Ù. .Pp NULL ´Â ¾Æ´Ï´Ù .Fa value_ptr Àμö¸¦ °¡Áø´Ù .Fn pthread_join ÀÇ È£Ãâ·ÎºÎÅÍ ¼º°ø¸®·Î µ¹¾Æ¿ÔÀ» ¶§¿¡´Â, Á¾·áÇÑ thread¿¡ ÀÇÇØ .Fn pthread_exit ¿¡°Ô °Ç³×Áø °ªÀÌ, .Fa value_ptr ¿¡ ÀÇÇØ ÂüÁ¶µÇ´Â À§Ä¡¿¡ °Ý³³µË´Ï´Ù. .Fn pthread_join ÇÏÁö¸¸ ¼º°ø¸®·Î µ¹¾Æ¿ÔÀ» ¶§¿¡´Â, ±× ´ë»ó thread´Â ÀÌ¹Ì Á¾·áÇϰí ÀÖ½À´Ï´Ù. °°Àº ´ë»ó thread¸¦ ÁöÁ¤ÇÑ º¹¼ö·Î µ¿½ÃÀÇ .Fn pthread_join ÀÇ È£Ãâ¿¡ ÀÇÇÑ °á°ú´Â, ¹ÌÁ¤µµ¸®ÀÔ´Ï´Ù. .Fn pthread_join (À»)¸¦ È£ÃâÇϰí ÀÖ´Â thread°¡ »èÁ¦µÇ¾úÀ» °æ¿ì¿¡´Â, ±× ´ë»ó thread´Â µ¥Å¿Ä¡ µÇÁö ¾Ê½À´Ï´Ù. .Pp ÀÌ¹Ì Á¾·áÇßÁö¸¸ °¡Á® ¹Þ°í µÇÁö ¾Ê°í ³²¾Æ ÀÖ´Â thread´Â, [_POSIX_THREAD_THREADS_MAX] ¿¡ ´ëÇØ¼­ Ä«¿îÆ® µË´Ï´Ù. .Pp .Sh ¹Ýȯ°ª ¹®Á¦°¡ ¾ø´Â °æ¿ì´Â, .Fn pthread_join ÇÔ¼ö´Â 0 À» µ¹·ÁÁÝ´Ï´Ù. ¹®Á¦°¡ ÀÖ´Â °æ¿ì´Â, ±× ¿¡·¯¸¦ ³ªÅ¸³»±â À§Çؼ­(¶§¹®¿¡) ¿¡·¯ ¹øÈ£°¡ µ¹·ÁÁÖ¾îÁý´Ï´Ù. .Sh ¿¡·¯ .Fn pthread_join (Àº)´Â ÀÌÇÏÀÇ °æ¿ì¿¡ ½ÇÆÐÇÕ´Ï´Ù. .Bl -tag -width Er .It Bq Er EINVAL .Fa thread ¿¡ ÀÇÇØ ÁöÁ¤µÈ °ªÀÌ, ´ë±âµÇ´Â °ÍÀÌ °¡´ÉÇÑ thread¸¦ ÂüÁ¶Çϰí ÀÖÁö ¾Ê´Â °ÍÀ» °ËÃâÇß½À´Ï´Ù. .It Bq Er ESRCH ÁÖ¾îÁø thread ID, .Fa thread ¿¡ ÀÇÇØ ÁöÁ¤µÈ °Í°ú ÀÏÄ¡ÇÏ´Â thread¸¦ ã¾Æ³¾ ¼ö°¡ ¾ø½À´Ï´Ù. .It Bq Er EDEADLK µ¥µå ·ÏÀ» °ËÃâÇß½À´Ï´Ù. ¶Ç´Â, .Fa thread ÀÇ °ªÀÌ È£ÃâÇϰí ÀÖ´Â thread¸¦ ÁöÁ¤ÇØ ÀÖ½À´Ï´Ù. .El .Pp .Sh °ü·Ã Ç׸ñ .Xr wait 2 , .Xr pthread_create 3 .Sh Ç¥ÁØ .Fn pthread_join ÇÏ .St -p1003.1-96 ¿¡ ÀûÇÕÇϰí ÀÖ½À´Ï´Ù.