![]() icansleep() violates the lock ordering due to the following cases: rbfree(): ilock(Rbpool.Lock) -> wakeup(): spli(), lock(Rbpool.Rendez) sleep(): splhi(), lock(Rbpool.Rendez) -> icansleep(): ilock(Rbpool.Lock) erik fixed this moving the wakeup() out of the ilock() in rbfree(), but i think it is an error to try acquiering a ilock in sleeps wait condition function in general. so this is what we do: in the icansleep() function, we check for the *real* event we care about; that is, if theres a buffer available in the Rbpool. this is to handle the case when rbfree() makes a buffer available *before* it sees us setting p->starve = 1. p->starve is now just used to gate rbfree() from calling wakeup() as an optimization. this might cause spurious wakeups but they are not a problem. missed wakeups is the thing we have to prevent. |
||
---|---|---|
.. | ||
9 | ||
ape | ||
boot | ||
cmd | ||
games | ||
lib9p | ||
libaml | ||
libauth | ||
libauthsrv | ||
libavl | ||
libbin | ||
libbio | ||
libc | ||
libcomplete | ||
libcontrol | ||
libdisk | ||
libdraw | ||
libfis | ||
libflate | ||
libframe | ||
libgeometry | ||
libhtml | ||
libhttpd | ||
libip | ||
liblex | ||
libmach | ||
libmemdraw | ||
libmemlayer | ||
libmp | ||
libndb | ||
liboventi | ||
libplumb | ||
libregexp | ||
libscribble | ||
libsec | ||
libstdio | ||
libString | ||
libsunrpc | ||
libthread | ||
libventi | ||
mkfile | ||
mkfile.proto | ||
NOTICE |