mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Cleanup and fix mutex init, no need for a flag now.
This commit is contained in:
parent
f38c9b4bc8
commit
65cfc8de86
1 changed files with 0 additions and 12 deletions
|
@ -107,7 +107,6 @@ struct LwMutex : public KernelObject
|
||||||
std::vector<SceUID> waitingThreads;
|
std::vector<SceUID> waitingThreads;
|
||||||
};
|
};
|
||||||
|
|
||||||
bool mutexInitComplete = false;
|
|
||||||
int mutexWaitTimer = 0;
|
int mutexWaitTimer = 0;
|
||||||
int lwMutexWaitTimer = 0;
|
int lwMutexWaitTimer = 0;
|
||||||
// Thread -> Mutex locks for thread end.
|
// Thread -> Mutex locks for thread end.
|
||||||
|
@ -119,12 +118,7 @@ void __KernelMutexInit()
|
||||||
mutexWaitTimer = CoreTiming::RegisterEvent("MutexTimeout", &__KernelMutexTimeout);
|
mutexWaitTimer = CoreTiming::RegisterEvent("MutexTimeout", &__KernelMutexTimeout);
|
||||||
lwMutexWaitTimer = CoreTiming::RegisterEvent("LwMutexTimeout", &__KernelLwMutexTimeout);
|
lwMutexWaitTimer = CoreTiming::RegisterEvent("LwMutexTimeout", &__KernelLwMutexTimeout);
|
||||||
|
|
||||||
// TODO: Install on first mutex (if it's slow?)
|
|
||||||
__KernelListenThreadEnd(&__KernelMutexThreadEnd);
|
__KernelListenThreadEnd(&__KernelMutexThreadEnd);
|
||||||
|
|
||||||
mutexInitComplete = true;
|
|
||||||
mutexWaitTimer = 0;
|
|
||||||
lwMutexWaitTimer = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void __KernelMutexShutdown()
|
void __KernelMutexShutdown()
|
||||||
|
@ -191,9 +185,6 @@ std::vector<SceUID>::iterator __KernelMutexFindPriority(std::vector<SceUID> &wai
|
||||||
|
|
||||||
int sceKernelCreateMutex(const char *name, u32 attr, int initialCount, u32 optionsPtr)
|
int sceKernelCreateMutex(const char *name, u32 attr, int initialCount, u32 optionsPtr)
|
||||||
{
|
{
|
||||||
if (!mutexInitComplete)
|
|
||||||
__KernelMutexInit();
|
|
||||||
|
|
||||||
if (!name)
|
if (!name)
|
||||||
{
|
{
|
||||||
WARN_LOG(HLE, "%08x=sceKernelCreateMutex(): invalid name", SCE_KERNEL_ERROR_ERROR);
|
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)
|
int sceKernelCreateLwMutex(u32 workareaPtr, const char *name, u32 attr, int initialCount, u32 optionsPtr)
|
||||||
{
|
{
|
||||||
if (!mutexInitComplete)
|
|
||||||
__KernelMutexInit();
|
|
||||||
|
|
||||||
if (!name)
|
if (!name)
|
||||||
{
|
{
|
||||||
WARN_LOG(HLE, "%08x=sceKernelCreateLwMutex(): invalid name", SCE_KERNEL_ERROR_ERROR);
|
WARN_LOG(HLE, "%08x=sceKernelCreateLwMutex(): invalid name", SCE_KERNEL_ERROR_ERROR);
|
||||||
|
|
Loading…
Add table
Reference in a new issue