sleeping while at spltty?

Chris Torek chris at mimsy.UUCP
Sun Apr 16 21:53:36 AEST 1989


In article <824 at twwells.uucp> bill at twwells.uucp (T. William Wells) writes:
>	splsave = spltty();
>	while (!carrier_detect || already_opened) {
>		sleep(&line_flags, 29);
>	}
>	splx(splsave);
>... could someone clue me in on what is really happening?

Sleep() puts the current process to sleep, saving its state *including*
IPL.  A later wakeup() puts it back on the run queue, and when it is
subsequently resumed the IPL is restored to whatever its value was when
the code called sleep().  The carrier detect flag is thus set while the
process is sleeping.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris at mimsy.umd.edu	Path:	uunet!mimsy!chris



More information about the Comp.unix.wizards mailing list