mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-15 23:40:29 +02:00
Make mutexes handle callbacks better + before.
Mutex and semaphores (but NOT lwmutexes) call callbacks before attempting the lock, but only if it would not generate errors. Have not yet tested other wait types.
This commit is contained in:
1 parent
eace0e75c1
commit
fe60677f75
4 files changed
+195
-61
No files matched your search
@@ -1195,6 +1195,26 @@ void __KernelWaitCurThread(WaitType type, SceUID waitID, u32 waitValue, u32 time
|
||||
// TODO: Remove thread from Ready queue?
|
||||
}
|
||||
|
||||
void __KernelWaitCallbacksCurThread(WaitType type, SceUID waitID, u32 waitValue, u32 timeoutPtr)
|
||||
{
|
||||
if (!dispatchEnabled)
|
||||
{
|
||||
WARN_LOG_REPORT(HLE, "Ignoring wait, dispatching disabled... right thing to do?");
|
||||
return;
|
||||
}
|
||||
|
||||
Thread *thread = __GetCurrentThread();
|
||||
thread->nt.waitID = waitID;
|
||||
thread->nt.waitType = type;
|
||||
__KernelChangeThreadState(thread, THREADSTATUS_WAIT);
|
||||
// TODO: Probably not...?
|
||||
thread->nt.numReleases++;
|
||||
thread->waitInfo.waitValue = waitValue;
|
||||
thread->waitInfo.timeoutPtr = timeoutPtr;
|
||||
|
||||
__KernelForceCallbacks();
|
||||
}
|
||||
|
||||
void hleScheduledWakeup(u64 userdata, int cyclesLate)
|
||||
{
|
||||
SceUID threadID = (SceUID)userdata;
|
||||
|
||||
Reference in new issue
Block a user