Date: Fri, 04 Mar 2005 12:07:13 -0500 From: Ken Smith <kensmith@cse.Buffalo.EDU> To: Colin Percival <cperciva@FreeBSD.org> Cc: David Xu <davidxu@FreeBSD.org> Subject: Re: cvs commit: src/sys/kern kern_sig.c Message-ID: <1109956033.84748.4.camel@opus.cse.buffalo.edu> In-Reply-To: <42288FA6.7010102@freebsd.org> References: <Pine.GSO.4.43.0503031020180.2058-100000@sea.ntplx.net> <200503031116.22840.jhb@FreeBSD.org><42288FA6.7010102@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1109956033.84748.4.camel>