From owner-freebsd-arch@FreeBSD.ORG Mon Mar 31 09:05:23 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E97AB37B401 for ; Mon, 31 Mar 2003 09:05:23 -0800 (PST) Received: from duke.cs.duke.edu (duke.cs.duke.edu [152.3.140.1]) by mx1.FreeBSD.org (Postfix) with ESMTP id 443A243FA3 for ; Mon, 31 Mar 2003 09:05:23 -0800 (PST) (envelope-from gallatin@cs.duke.edu) Received: from grasshopper.cs.duke.edu (grasshopper.cs.duke.edu [152.3.145.30]) by duke.cs.duke.edu (8.12.9/8.12.9) with ESMTP id h2VH5MMS019097 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 31 Mar 2003 12:05:22 -0500 (EST) Received: (from gallatin@localhost) by grasshopper.cs.duke.edu (8.11.6/8.9.1) id h2VH5H227344; Mon, 31 Mar 2003 12:05:17 -0500 (EST) (envelope-from gallatin@cs.duke.edu) From: Andrew Gallatin MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16008.30029.620721.433243@grasshopper.cs.duke.edu> Date: Mon, 31 Mar 2003 12:05:17 -0500 (EST) To: freebsd-arch@freebsd.org X-Mailer: VM 6.75 under 21.1 (patch 12) "Channel Islands" XEmacs Lucid Subject: cv_timedwait() & exiting procs X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Mar 2003 17:05:25 -0000 FreeBSD's cv_timedwait() function helpfully notices that a process is exiting and returns EWOULDBLOCK if it is. However, if you call cv_timedwait() in the context of a process which is already exiting, you always get back EWOULDBLOCK, regardless of whether or not the timeout expired. Similarly for the cv_wait_sig() and cv_timedwait_sig(), except they set EINTR. Does anyone else consider this behaviour to be a bug? I think it should only return EWOULDBLOCK/EINTR because a process is exiting if the process wasn't already exiting when it entered the cv_*wait* routine, but perhaps I'm misguided... Drew