From: John Hodge Date: Sat, 27 Sep 2014 05:34:39 +0000 (+0800) Subject: Kernel - Minor fix to logic in rwlock X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=641a3c5a09b61973431c5772333f65eeb76e76c0;p=tpg%2Facess2.git Kernel - Minor fix to logic in rwlock --- diff --git a/KernelLand/Kernel/rwlock.c b/KernelLand/Kernel/rwlock.c index c39ce10a..1fd64592 100644 --- a/KernelLand/Kernel/rwlock.c +++ b/KernelLand/Kernel/rwlock.c @@ -21,7 +21,8 @@ int RWLock_AcquireRead(tRWLock *Lock) SHORTLOCK( &Lock->Protector ); // Check if the lock is already held by a writer - if( Lock->Owner ) + // - OR, there's a writer waiting to write + if( Lock->Owner || Lock->WriterWaiting ) { LOG("Waiting"); Threads_int_Sleep(THREAD_STAT_RWLOCKSLEEP, Lock, 0,