From owner-freebsd-hackers@FreeBSD.ORG Thu Mar 17 01:54:07 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA3BE1065673; Thu, 17 Mar 2011 01:54:07 +0000 (UTC) (envelope-from davidxu@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 96A3B8FC12; Thu, 17 Mar 2011 01:54:07 +0000 (UTC) Received: from xyf.my.dom (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p2H1s5xx023745; Thu, 17 Mar 2011 01:54:06 GMT (envelope-from davidxu@freebsd.org) Message-ID: <4D8169BF.6090503@freebsd.org> Date: Thu, 17 Mar 2011 09:54:07 +0800 From: David Xu User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.13) Gecko/20110127 Thunderbird/3.1.7 MIME-Version: 1.0 To: Yuri References: <4D6ABA14.80208@rawbw.com> <4D6AC17A.7020505@rawbw.com> <4D6B01DB.9090909@freebsd.org> <4D80D5E0.5080302@rawbw.com> In-Reply-To: <4D80D5E0.5080302@rawbw.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Garrett Cooper , freebsd-hackers@freebsd.org, standards@freebsd.org Subject: Re: Is pthread_cond_signal(3) man page correct? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2011 01:54:07 -0000 On 2011/03/16 23:23, Yuri wrote: > On 02/27/2011 18:00, David Xu wrote: >> I think in normal case, pthread_cond_signal will wake up one thread, >> but other events for example, UNIX signal and fork() may interrupt >> a thread sleeping in kernel, and cause pthread_cond_wait to return >> to userland, this is called spurious wakeup, and other events, I >> can not think of yet, but I believe they exist. >> > > Does this mean that pthread_cond_signal can also return EINTR? This > isn't in pthread_cond_signal(3) either. > No, it will return zero, returning EINTR is not allowed. > Is this the case that all system calls should be assumed to be able to > return EINTR or only those that have EINTR in their man pages? > > Yuri >