Merge branch 'master' of git://git.ucc.asn.au/tpg/acess2
[tpg/acess2.git] / 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