cvs commit: src/sys/kern kern_sig.c

Ken Smith kensmith at cse.Buffalo.EDU
Fri Mar 4 09:07:22 PST 2005


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




More information about the cvs-all mailing list