Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Feb 2004 15:43:43 -0500
From:      John Baldwin <jhb@FreeBSD.org>
To:        Daniel Eischen <eischen@vigrid.com>
Cc:        threads@freebsd.org
Subject:   Re: Proper algorithm for return values from sleep
Message-ID:  <200402271543.43087.jhb@FreeBSD.org>
In-Reply-To: <Pine.GSO.4.10.10402271532120.3269-100000@pcnet5.pcnet.com>
References:  <Pine.GSO.4.10.10402271532120.3269-100000@pcnet5.pcnet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday 27 February 2004 03:35 pm, Daniel Eischen wrote:
> On Fri, 27 Feb 2004, John Baldwin wrote:
> > As part of my sleep queue work, I found that msleep() and the cv_wait()
> > functions have differing semantics for return vales.  It appears that at
> > least some of the early changes KSE made to msleep() were ported to cv's
> > but not later cleanups.  Specifically, in msleep(), if we are awakened
> > while checking for signals but we didn't find a signal, we prefer a
> > timeout-related return value over a signal-related value.
>
> It doesn't look like kern_thread.c uses any return values from msleep.
> Where else would one look?  I would think that cv's would want to behave
> in the same manner.

Not specific to kern_thread.c, but the values msleep() itself returns to all 
callers.   Compare the implementation of msleep() and cv_timedwait_sig() 
post-sleep queues to see some of the XXX comments and differing code.

-- 
John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200402271543.43087.jhb>