summaryrefslogtreecommitdiffstats
path: root/src/core/hle/kernel/scheduler.cpp
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2020-03-07 01:36:05 +0100
committerFernando Sahmkow <fsahmkow27@gmail.com>2020-06-27 17:35:31 +0200
commit6ed28e15fa9f4c727cf24990c35b13a35547d943 (patch)
tree41c7658c10675d16f1776a50ee0c96921dac074e /src/core/hle/kernel/scheduler.cpp
parentScheduler: Protect on closed threads. (diff)
downloadyuzu-6ed28e15fa9f4c727cf24990c35b13a35547d943.tar
yuzu-6ed28e15fa9f4c727cf24990c35b13a35547d943.tar.gz
yuzu-6ed28e15fa9f4c727cf24990c35b13a35547d943.tar.bz2
yuzu-6ed28e15fa9f4c727cf24990c35b13a35547d943.tar.lz
yuzu-6ed28e15fa9f4c727cf24990c35b13a35547d943.tar.xz
yuzu-6ed28e15fa9f4c727cf24990c35b13a35547d943.tar.zst
yuzu-6ed28e15fa9f4c727cf24990c35b13a35547d943.zip
Diffstat (limited to 'src/core/hle/kernel/scheduler.cpp')
-rw-r--r--src/core/hle/kernel/scheduler.cpp10
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() {
current_thread = selected_thread;
guard.unlock();
while (!is_context_switch_pending) {
- current_thread->context_guard.lock();
- if (current_thread->GetSchedulingStatus() != ThreadSchedStatus::Runnable) {
- current_thread->context_guard.unlock();
- break;
+ if (current_thread != nullptr) {
+ current_thread->context_guard.lock();
+ if (current_thread->GetSchedulingStatus() != ThreadSchedStatus::Runnable) {
+ current_thread->context_guard.unlock();
+ break;
+ }
}
std::shared_ptr<Common::Fiber> next_context;
if (current_thread != nullptr) {