mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Forget mutex waiting threads when they timeout.
This commit is contained in:
parent
8da2fb074c
commit
dd3db71b61
1 changed files with 9 additions and 0 deletions
|
@ -17,6 +17,7 @@
|
|||
|
||||
// UNFINISHED
|
||||
|
||||
#include <algorithm>
|
||||
#include "HLE.h"
|
||||
#include "../MIPS/MIPS.h"
|
||||
#include "../../Core/CoreTiming.h"
|
||||
|
@ -236,6 +237,14 @@ void __KernelMutexTimeout(u64 userdata, int cyclesLate)
|
|||
if (timeoutPtr != 0)
|
||||
Memory::Write_U32(0, timeoutPtr);
|
||||
|
||||
SceUID mutexID = __KernelGetWaitID(threadID, error);
|
||||
Mutex *mutex = kernelObjects.Get<Mutex>(mutexID, error);
|
||||
if (mutex)
|
||||
{
|
||||
// This thread isn't waiting anymore.
|
||||
mutex->waitingThreads.erase(std::remove(mutex->waitingThreads.begin(), mutex->waitingThreads.end(), threadID), mutex->waitingThreads.end());
|
||||
}
|
||||
|
||||
__KernelResumeThreadFromWait(threadID, SCE_KERNEL_ERROR_WAIT_TIMEOUT);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue