From owner-cvs-src@FreeBSD.ORG Fri Mar 4 17:07:21 2005 Return-Path: Delivered-To: cvs-src@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9233C16A4CE; Fri, 4 Mar 2005 17:07:21 +0000 (GMT) Received: from opus.cse.buffalo.edu (opus.cse.Buffalo.EDU [128.205.32.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2CA4843D5D; Fri, 4 Mar 2005 17:07:21 +0000 (GMT) (envelope-from kensmith@cse.Buffalo.EDU) Received: from localhost.localdomain (opus.cse.buffalo.edu [128.205.32.4]) by opus.cse.buffalo.edu (8.13.1/8.12.10) with ESMTP id j24H7Dei085365; Fri, 4 Mar 2005 12:07:13 -0500 (EST) From: Ken Smith To: Colin Percival In-Reply-To: <42288FA6.7010102@freebsd.org> References: <200503031116.22840.jhb@FreeBSD.org><42288FA6.7010102@freebsd.org> Content-Type: text/plain Organization: U. Buffalo CSE Department Date: Fri, 04 Mar 2005 12:07:13 -0500 Message-Id: <1109956033.84748.4.camel@opus.cse.buffalo.edu> Mime-Version: 1.0 X-Mailer: Evolution 2.0.4 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit cc: Scott Long cc: src-committers@FreeBSD.org cc: Bruce Evans cc: John Baldwin cc: cvs-src@FreeBSD.org cc: cvs-all@FreeBSD.org cc: Daniel Eischen cc: David Xu Subject: Re: cvs commit: src/sys/kern kern_sig.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Mar 2005 17:07:21 -0000 On Fri, 2005-03-04 at 08:41 -0800, Colin Percival wrote: > Bruce Evans wrote: > > Sleeping on a stack address is just a bug [...] > > I was told that this was the canonical way to say "go to sleep and don't > wake up until the timo expires" was to tsleep() with ident equal to > something from the stack. > > If this isn't correct, what is the correct way to do this? I've seen > some code which does tsleep(NULL, ... ), but I was told that was also > wrong. > > Colin Percival My copy of "The Design/Imp of FreeBSD" is at home but if this tidbit hasn't changed from "The Design/Imp of 4.4BSD" which I do have handy then: When a process does a sigpause system call, it does not want to run until it receives a signal. Thus, it needs to do an interrupible sleep on a wait channel that will never be awakened. By convention, the address of the user structure is given as the wait channel. YMMV... -ken