diff options
author | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2022-07-10 07:59:40 +0200 |
---|---|---|
committer | Kelebek1 <eeeedddccc@hotmail.co.uk> | 2022-07-10 07:59:40 +0200 |
commit | 240650f6a6336df8d3eb11b410cdcd332d8ad562 (patch) | |
tree | 16ae249e6160a22f88bd2238d43b23079c4afb44 /src/core/hle/kernel/kernel.cpp | |
parent | Merge pull request #8531 from FernandoS27/core-timing-fix-reg (diff) | |
download | yuzu-240650f6a6336df8d3eb11b410cdcd332d8ad562.tar yuzu-240650f6a6336df8d3eb11b410cdcd332d8ad562.tar.gz yuzu-240650f6a6336df8d3eb11b410cdcd332d8ad562.tar.bz2 yuzu-240650f6a6336df8d3eb11b410cdcd332d8ad562.tar.lz yuzu-240650f6a6336df8d3eb11b410cdcd332d8ad562.tar.xz yuzu-240650f6a6336df8d3eb11b410cdcd332d8ad562.tar.zst yuzu-240650f6a6336df8d3eb11b410cdcd332d8ad562.zip |
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
-rw-r--r-- | src/core/hle/kernel/kernel.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index 0009193be..ee91a9b68 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp @@ -234,17 +234,19 @@ struct KernelCore::Impl { void InitializePreemption(KernelCore& kernel) { preemption_event = Core::Timing::CreateEvent( - "PreemptionCallback", [this, &kernel](std::uintptr_t, std::chrono::nanoseconds) { + "PreemptionCallback", + [this, &kernel](std::uintptr_t, s64 time, + std::chrono::nanoseconds) -> std::optional<std::chrono::nanoseconds> { { KScopedSchedulerLock lock(kernel); global_scheduler_context->PreemptThreads(); } - const auto time_interval = std::chrono::nanoseconds{std::chrono::milliseconds(10)}; - system.CoreTiming().ScheduleEvent(time_interval, preemption_event); + return std::nullopt; }); const auto time_interval = std::chrono::nanoseconds{std::chrono::milliseconds(10)}; - system.CoreTiming().ScheduleEvent(time_interval, preemption_event); + system.CoreTiming().ScheduleLoopingEvent(std::chrono::nanoseconds(0), time_interval, + preemption_event); } void InitializeShutdownThreads() { |