fork of 9front i guess
![]() the initial issue was that wunlock() would wakeup readers while holding the spinlock causing deadlock in libthread programs where rendezvous() would do a thread switch within the same process which then can acquire the RWLock again. the first fix tried to prevent holding the spinlock, waking up one reader at a time with releasing an re-acquiering the spinlock. this violates the invariant that readers can only wakup writers in runlock() when multiple readers where queued at the time of wunlock(). at the first wakeup, q->head != nil so runlock() would find a reader queued on runlock() when it expected a writer. this (hopefully last) fix unlinks *all* the reader QLp's atomically and in order while holding the spinlock and then traverses the dequeued chain of QLp structures again to call rendezvous() so the invariant described above holds. |
||
---|---|---|
386 | ||
68000 | ||
68020 | ||
acme | ||
adm/timezone | ||
amd64 | ||
arm | ||
lib | ||
mips | ||
power | ||
power64 | ||
rc | ||
sparc | ||
sparc64 | ||
spim | ||
sys | ||
.hgignore |