From 641a3c5a09b61973431c5772333f65eeb76e76c0 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Sat, 27 Sep 2014 13:34:39 +0800 Subject: [PATCH] Kernel - Minor fix to logic in rwlock --- KernelLand/Kernel/rwlock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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, -- 2.20.1