Kernel - Minor fix to logic in rwlock
authorJohn Hodge <[email protected]>
Sat, 27 Sep 2014 05:34:39 +0000 (13:34 +0800)
committerJohn Hodge <[email protected]>
Sat, 27 Sep 2014 05:34:39 +0000 (13:34 +0800)
KernelLand/Kernel/rwlock.c

index c39ce10..1fd6459 100644 (file)
@@ -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,

UCC git Repository :: git.ucc.asn.au