fork of 9front i guess
Go to file
cinap_lenrek ac52599eef ether82563: avoid deadlock due to icansleep() trying to acquire Rbpool.Lock
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.
2013-07-26 01:51:03 +02:00
386
68000
68020
acme acme: fix more error messages 2013-04-28 00:19:35 +02:00
adm/timezone add Uruguay timezone (from sources) 2013-01-25 14:13:01 +01:00
alpha
amd64
arm
lib fortunes: Let me put in a word about the Apple wireless trackpad. 2013-07-05 15:41:51 -04:00
mips
power
power64
rc rexec: redirect error (fd=2) to network for tcp17009 2013-07-12 23:16:49 +02:00
sparc
sparc64
sys ether82563: avoid deadlock due to icansleep() trying to acquire Rbpool.Lock 2013-07-26 01:51:03 +02:00
.hgignore hgignore: ignore stuff in /lib/rfc 2013-06-09 11:16:33 -04:00