Proper algorithm for return values from sleep

Daniel Eischen eischen at vigrid.com
Fri Feb 27 12:35:51 PST 2004


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.

> Secondly, cv's don't really handle 
> td_intrval very well at all.  It has one hard-coded override for the P_EXIT 
> case but that's it.

I'm not sure about this.  Julian or David would know better.

-- 
Dan Eischen



More information about the freebsd-threads mailing list