mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Fix wrong thread id when resuming after interrupt.
Who knows what kind of havoc this was causing.
This commit is contained in:
parent
4f2c7285fd
commit
a1e69d1c4f
1 changed files with 3 additions and 1 deletions
|
@ -1011,6 +1011,8 @@ void __KernelFireThreadEnd(SceUID threadID)
|
||||||
// TODO: Use __KernelChangeThreadState instead? It has other affects...
|
// TODO: Use __KernelChangeThreadState instead? It has other affects...
|
||||||
void __KernelChangeReadyState(Thread *thread, SceUID threadID, bool ready)
|
void __KernelChangeReadyState(Thread *thread, SceUID threadID, bool ready)
|
||||||
{
|
{
|
||||||
|
// Passing the id as a parameter is just an optimization, if it's wrong it will cause havoc.
|
||||||
|
_dbg_assert_msg_(HLE, thread->GetUID() == threadID, "Incorrect threadID");
|
||||||
int prio = thread->nt.currentPriority;
|
int prio = thread->nt.currentPriority;
|
||||||
|
|
||||||
if (thread->isReady())
|
if (thread->isReady())
|
||||||
|
@ -1101,7 +1103,7 @@ bool __KernelSwitchToThread(SceUID threadID, const char *reason)
|
||||||
{
|
{
|
||||||
Thread *current = __GetCurrentThread();
|
Thread *current = __GetCurrentThread();
|
||||||
if (current && current->isRunning())
|
if (current && current->isRunning())
|
||||||
__KernelChangeReadyState(current, threadID, true);
|
__KernelChangeReadyState(current, currentThread, true);
|
||||||
|
|
||||||
__KernelSwitchContext(t, reason);
|
__KernelSwitchContext(t, reason);
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue