mirror of
https://github.com/citra-emu/citra.git
synced 2024-11-25 05:40:14 +00:00
Reschedule: Handle the case when next->status == THREADSTATUS_READY
This commit is contained in:
parent
e33f17b046
commit
63b0687242
@ -564,8 +564,16 @@ void Reschedule() {
|
||||
HLE::DoneRescheduling();
|
||||
|
||||
// Don't bother switching to the same thread
|
||||
if (next == cur)
|
||||
if (next == cur) {
|
||||
if (next) {
|
||||
// The status can be THREADSTATUS_READY and not THREADSTATUS_RUNNING as one would expect.
|
||||
// This occurs in the case when an object the thread is waiting on immediately wakes up
|
||||
// the current thread before Reschedule() is called.
|
||||
ASSERT(next->status == THREADSTATUS_RUNNING || next->status == THREADSTATUS_READY);
|
||||
next->status = THREADSTATUS_RUNNING;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (cur && next) {
|
||||
LOG_TRACE(Kernel, "context switch %u -> %u", cur->GetObjectId(), next->GetObjectId());
|
||||
|
Loading…
Reference in New Issue
Block a user