From 65cfc8de86a79b05957644d5cd7737f1282000d7 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 23 Dec 2012 18:27:07 -0800 Subject: [PATCH] Cleanup and fix mutex init, no need for a flag now. --- Core/HLE/sceKernelMutex.cpp | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/Core/HLE/sceKernelMutex.cpp b/Core/HLE/sceKernelMutex.cpp index c4c4b6e1f..c90bec98c 100644 --- a/Core/HLE/sceKernelMutex.cpp +++ b/Core/HLE/sceKernelMutex.cpp @@ -107,7 +107,6 @@ struct LwMutex : public KernelObject std::vector waitingThreads; }; -bool mutexInitComplete = false; int mutexWaitTimer = 0; int lwMutexWaitTimer = 0; // Thread -> Mutex locks for thread end. @@ -119,12 +118,7 @@ void __KernelMutexInit() mutexWaitTimer = CoreTiming::RegisterEvent("MutexTimeout", &__KernelMutexTimeout); lwMutexWaitTimer = CoreTiming::RegisterEvent("LwMutexTimeout", &__KernelLwMutexTimeout); - // TODO: Install on first mutex (if it's slow?) __KernelListenThreadEnd(&__KernelMutexThreadEnd); - - mutexInitComplete = true; - mutexWaitTimer = 0; - lwMutexWaitTimer = 0; } void __KernelMutexShutdown() @@ -191,9 +185,6 @@ std::vector::iterator __KernelMutexFindPriority(std::vector &wai int sceKernelCreateMutex(const char *name, u32 attr, int initialCount, u32 optionsPtr) { - if (!mutexInitComplete) - __KernelMutexInit(); - if (!name) { WARN_LOG(HLE, "%08x=sceKernelCreateMutex(): invalid name", SCE_KERNEL_ERROR_ERROR); @@ -507,9 +498,6 @@ int sceKernelUnlockMutex(SceUID id, int count) int sceKernelCreateLwMutex(u32 workareaPtr, const char *name, u32 attr, int initialCount, u32 optionsPtr) { - if (!mutexInitComplete) - __KernelMutexInit(); - if (!name) { WARN_LOG(HLE, "%08x=sceKernelCreateLwMutex(): invalid name", SCE_KERNEL_ERROR_ERROR);