hle: kernel: fix scheduling ops from HLE host thread.

This commit is contained in:
FernandoS27 2021-11-26 18:15:43 +01:00 committed by bunnei
parent abbea575cf
commit 3c2a451f47

View file

@ -240,8 +240,8 @@ void KScheduler::OnThreadPriorityChanged(KernelCore& kernel, KThread* thread, s3
// If the thread is runnable, we want to change its priority in the queue. // If the thread is runnable, we want to change its priority in the queue.
if (thread->GetRawState() == ThreadState::Runnable) { if (thread->GetRawState() == ThreadState::Runnable) {
GetPriorityQueue(kernel).ChangePriority( GetPriorityQueue(kernel).ChangePriority(old_priority,
old_priority, thread == kernel.CurrentScheduler()->GetCurrentThread(), thread); thread == kernel.GetCurrentEmuThread(), thread);
IncrementScheduledCount(thread); IncrementScheduledCount(thread);
SetSchedulerUpdateNeeded(kernel); SetSchedulerUpdateNeeded(kernel);
} }
@ -360,7 +360,7 @@ void KScheduler::RotateScheduledQueue(s32 cpu_core_id, s32 priority) {
} }
bool KScheduler::CanSchedule(KernelCore& kernel) { bool KScheduler::CanSchedule(KernelCore& kernel) {
return kernel.CurrentScheduler()->GetCurrentThread()->GetDisableDispatchCount() <= 1; return kernel.GetCurrentEmuThread()->GetDisableDispatchCount() <= 1;
} }
bool KScheduler::IsSchedulerUpdateNeeded(const KernelCore& kernel) { bool KScheduler::IsSchedulerUpdateNeeded(const KernelCore& kernel) {