diff options
author | bunnei <bunneidev@gmail.com> | 2021-03-05 08:59:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-05 08:59:06 +0100 |
commit | 34a3ee16319ddcfe855249c2fe48b6e7b6441526 (patch) | |
tree | 24ff38e19a77b60201ee028b6abb476d82fc16d0 /src/core/hle/kernel/k_scheduler.cpp | |
parent | Merge pull request #5989 from ReinUsesLisp/cmdpool (diff) | |
parent | core: Switch to unique_ptr for usage of Common::Fiber. (diff) | |
download | yuzu-34a3ee16319ddcfe855249c2fe48b6e7b6441526.tar yuzu-34a3ee16319ddcfe855249c2fe48b6e7b6441526.tar.gz yuzu-34a3ee16319ddcfe855249c2fe48b6e7b6441526.tar.bz2 yuzu-34a3ee16319ddcfe855249c2fe48b6e7b6441526.tar.lz yuzu-34a3ee16319ddcfe855249c2fe48b6e7b6441526.tar.xz yuzu-34a3ee16319ddcfe855249c2fe48b6e7b6441526.tar.zst yuzu-34a3ee16319ddcfe855249c2fe48b6e7b6441526.zip |
Diffstat (limited to 'src/core/hle/kernel/k_scheduler.cpp')
-rw-r--r-- | src/core/hle/kernel/k_scheduler.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/core/hle/kernel/k_scheduler.cpp b/src/core/hle/kernel/k_scheduler.cpp index bb5f43b53..465036f3d 100644 --- a/src/core/hle/kernel/k_scheduler.cpp +++ b/src/core/hle/kernel/k_scheduler.cpp @@ -608,7 +608,7 @@ void KScheduler::YieldToAnyThread(KernelCore& kernel) { } KScheduler::KScheduler(Core::System& system, s32 core_id) : system(system), core_id(core_id) { - switch_fiber = std::make_shared<Common::Fiber>(OnSwitch, this); + switch_fiber = std::make_unique<Common::Fiber>(OnSwitch, this); state.needs_scheduling.store(true); state.interrupt_task_thread_runnable = false; state.should_count_idle = false; @@ -726,15 +726,15 @@ void KScheduler::ScheduleImpl() { // Save context for previous thread Unload(previous_thread); - std::shared_ptr<Common::Fiber>* old_context; + Common::Fiber* old_context; if (previous_thread != nullptr) { - old_context = &previous_thread->GetHostContext(); + old_context = previous_thread->GetHostContext(); } else { - old_context = &idle_thread->GetHostContext(); + old_context = idle_thread->GetHostContext(); } guard.unlock(); - Common::Fiber::YieldTo(*old_context, switch_fiber); + Common::Fiber::YieldTo(old_context, switch_fiber.get()); /// When a thread wakes up, the scheduler may have changed to other in another core. auto& next_scheduler = *system.Kernel().CurrentScheduler(); next_scheduler.SwitchContextStep2(); @@ -769,13 +769,13 @@ void KScheduler::SwitchToCurrent() { break; } } - std::shared_ptr<Common::Fiber>* next_context; + Common::Fiber* next_context; if (next_thread != nullptr) { - next_context = &next_thread->GetHostContext(); + next_context = next_thread->GetHostContext(); } else { - next_context = &idle_thread->GetHostContext(); + next_context = idle_thread->GetHostContext(); } - Common::Fiber::YieldTo(switch_fiber, *next_context); + Common::Fiber::YieldTo(switch_fiber.get(), next_context); } while (!is_switch_pending()); } } |