diff options
| author | 2020-03-06 20:36:05 -0400 | |
|---|---|---|
| committer | 2020-06-27 11:35:31 -0400 | |
| commit | 6ed28e15fa9f4c727cf24990c35b13a35547d943 (patch) | |
| tree | 41c7658c10675d16f1776a50ee0c96921dac074e /src/core/hle/kernel/scheduler.cpp | |
| parent | Scheduler: Protect on closed threads. (diff) | |
| download | yuzu-6ed28e15fa9f4c727cf24990c35b13a35547d943.tar.gz yuzu-6ed28e15fa9f4c727cf24990c35b13a35547d943.tar.xz yuzu-6ed28e15fa9f4c727cf24990c35b13a35547d943.zip | |
Scheduler: Fix HLE Threads on guard
Diffstat (limited to 'src/core/hle/kernel/scheduler.cpp')
| -rw-r--r-- | src/core/hle/kernel/scheduler.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/core/hle/kernel/scheduler.cpp b/src/core/hle/kernel/scheduler.cpp index 74d3731fc..d7529360c 100644 --- a/src/core/hle/kernel/scheduler.cpp +++ b/src/core/hle/kernel/scheduler.cpp | |||
| @@ -689,10 +689,12 @@ void Scheduler::SwitchToCurrent() { | |||
| 689 | current_thread = selected_thread; | 689 | current_thread = selected_thread; |
| 690 | guard.unlock(); | 690 | guard.unlock(); |
| 691 | while (!is_context_switch_pending) { | 691 | while (!is_context_switch_pending) { |
| 692 | current_thread->context_guard.lock(); | 692 | if (current_thread != nullptr) { |
| 693 | if (current_thread->GetSchedulingStatus() != ThreadSchedStatus::Runnable) { | 693 | current_thread->context_guard.lock(); |
| 694 | current_thread->context_guard.unlock(); | 694 | if (current_thread->GetSchedulingStatus() != ThreadSchedStatus::Runnable) { |
| 695 | break; | 695 | current_thread->context_guard.unlock(); |
| 696 | break; | ||
| 697 | } | ||
| 696 | } | 698 | } |
| 697 | std::shared_ptr<Common::Fiber> next_context; | 699 | std::shared_ptr<Common::Fiber> next_context; |
| 698 | if (current_thread != nullptr) { | 700 | if (current_thread != nullptr) { |