Proper algorithm for return values from sleep

John Baldwin jhb at
Fri Feb 27 11:54:16 PST 2004

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.  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.

John Baldwin <jhb at>  <><
"Power Users Use the Power to Serve"  =

More information about the freebsd-threads mailing list