plan9fox/sys/src
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
..
9 ether82563: avoid deadlock due to icansleep() trying to acquire Rbpool.Lock 2013-07-26 01:51:03 +02:00
ape ape: fix _main stack setup for arm (_privates and _errnoloc was inside argv) 2013-06-08 23:53:28 +02:00
boot
cmd readtif, writetif: remove multiplication in inner loops of predict functions 2013-07-21 10:56:11 -04:00
games
lib9p make filesystem handling of read9pmsg() consistent 2013-06-16 06:26:31 +02:00
libaml aml: preserve reference type when indexing into package to prevent implicit type conversion when storing to arg or local 2013-07-12 01:58:47 +02:00
libauth
libauthsrv
libavl
libbin
libbio
libc libc: fix compiler warning for mips canlock() and _tas() 2013-06-19 20:18:17 +02:00
libcomplete
libcontrol
libdisk
libdraw libdraw: fix allocscreen() memory leak with too many retries (from 9atom) 2013-06-19 20:13:55 +02:00
libfis
libflate
libframe
libgeometry
libhtml
libhttpd
libip
liblex
libmach libmach: add EMMS for disassembly (8db.c, thanks mischief) 2013-06-12 19:38:14 +02:00
libmemdraw draw: add badrect() function to reject zero, negative size or orverly huge rectangles 2013-06-16 19:01:46 +02:00
libmemlayer
libmp
libndb
liboventi
libplumb
libregexp
libscribble
libsec
libstdio
libString
libsunrpc
libthread
libventi
mkfile
mkfile.proto
NOTICE