Path: utzoo!attcan!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!mailrus!uflorida!haven!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.unix.wizards Subject: Re: sleeping while at spltty? Message-ID: <16956@mimsy.UUCP> Date: 16 Apr 89 11:53:36 GMT References: <824@twwells.uucp> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 16 In article <824@twwells.uucp> bill@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@mimsy.umd.edu Path: uunet!mimsy!chris