Skip to content
Snippets Groups Projects
Commit 77e039d9 authored by John Hodge's avatar John Hodge
Browse files

Kernel/mutex - Fixed double lock on glThreadListLock

parent 7009aab6
No related merge requests found
...@@ -27,7 +27,7 @@ int Mutex_Acquire(tMutex *Mutex) ...@@ -27,7 +27,7 @@ int Mutex_Acquire(tMutex *Mutex)
// Get protector // Get protector
SHORTLOCK( &Mutex->Protector ); SHORTLOCK( &Mutex->Protector );
//Log("Mutex_Acquire: (%p)", Mutex); // Log("Mutex_Acquire: (%p)", Mutex);
// Check if the lock is already held // Check if the lock is already held
if( Mutex->Owner ) { if( Mutex->Owner ) {
...@@ -94,17 +94,12 @@ void Mutex_Release(tMutex *Mutex) ...@@ -94,17 +94,12 @@ void Mutex_Release(tMutex *Mutex)
Mutex->Owner = Mutex->Waiting; // Set owner Mutex->Owner = Mutex->Waiting; // Set owner
Mutex->Waiting = Mutex->Waiting->Next; // Next! Mutex->Waiting = Mutex->Waiting->Next; // Next!
// Reset ->LastWaiting to NULL if we have just removed the last waiting thread // Reset ->LastWaiting to NULL if we have just removed the last waiting thread
// 2010-10-02 21:50 - Comemerating the death of the longest single
// blocker in the Acess2 history. REMEMBER TO
// FUCKING MAINTAIN YOUR FUCKING LISTS DIPWIT
if( Mutex->LastWaiting == Mutex->Owner ) if( Mutex->LastWaiting == Mutex->Owner )
Mutex->LastWaiting = NULL; Mutex->LastWaiting = NULL;
// Wake new owner // Wake new owner
SHORTLOCK( &glThreadListLock );
if( Mutex->Owner->Status != THREAD_STAT_ACTIVE ) if( Mutex->Owner->Status != THREAD_STAT_ACTIVE )
Threads_AddActive(Mutex->Owner); Threads_AddActive(Mutex->Owner);
SHORTREL( &glThreadListLock );
} }
else { else {
Mutex->Owner = NULL; Mutex->Owner = NULL;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment