yuzu-emu
/
yuzu-android
Archived
1
0
Fork 0

Scheduler: Correct locking for hle threads.

This commit is contained in:
Fernando Sahmkow 2020-03-06 22:58:56 -04:00
parent 6ed28e15fa
commit 44cb9997b3
1 changed files with 2 additions and 1 deletions

View File

@ -687,9 +687,10 @@ void Scheduler::SwitchToCurrent() {
guard.lock(); guard.lock();
selected_thread = selected_thread_set; selected_thread = selected_thread_set;
current_thread = selected_thread; current_thread = selected_thread;
is_context_switch_pending = false;
guard.unlock(); guard.unlock();
while (!is_context_switch_pending) { while (!is_context_switch_pending) {
if (current_thread != nullptr) { if (current_thread != nullptr && !current_thread->IsHLEThread()) {
current_thread->context_guard.lock(); current_thread->context_guard.lock();
if (current_thread->GetSchedulingStatus() != ThreadSchedStatus::Runnable) { if (current_thread->GetSchedulingStatus() != ThreadSchedStatus::Runnable) {
current_thread->context_guard.unlock(); current_thread->context_guard.unlock();