diff options
author | bunnei <bunneidev@gmail.com> | 2019-11-27 03:48:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-27 03:48:56 +0100 |
commit | ec0ce96c568b2b610c5218efd7faa5d9a19350f8 (patch) | |
tree | 61b5133e3cc6a9edf3b45c5fe6604493689f6769 /src/core/hle/kernel/kernel.cpp | |
parent | Merge pull request #3164 from ReinUsesLisp/half-cast-float (diff) | |
download | yuzu-ec0ce96c568b2b610c5218efd7faa5d9a19350f8.tar yuzu-ec0ce96c568b2b610c5218efd7faa5d9a19350f8.tar.gz yuzu-ec0ce96c568b2b610c5218efd7faa5d9a19350f8.tar.bz2 yuzu-ec0ce96c568b2b610c5218efd7faa5d9a19350f8.tar.lz yuzu-ec0ce96c568b2b610c5218efd7faa5d9a19350f8.tar.xz yuzu-ec0ce96c568b2b610c5218efd7faa5d9a19350f8.tar.zst yuzu-ec0ce96c568b2b610c5218efd7faa5d9a19350f8.zip |
Diffstat (limited to 'src/core/hle/kernel/kernel.cpp')
-rw-r--r-- | src/core/hle/kernel/kernel.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/core/hle/kernel/kernel.cpp b/src/core/hle/kernel/kernel.cpp index 63ad07950..a9851113a 100644 --- a/src/core/hle/kernel/kernel.cpp +++ b/src/core/hle/kernel/kernel.cpp @@ -139,12 +139,12 @@ struct KernelCore::Impl { void InitializeThreads() { thread_wakeup_event_type = - system.CoreTiming().RegisterEvent("ThreadWakeupCallback", ThreadWakeupCallback); + Core::Timing::CreateEvent("ThreadWakeupCallback", ThreadWakeupCallback); } void InitializePreemption() { - preemption_event = system.CoreTiming().RegisterEvent( - "PreemptionCallback", [this](u64 userdata, s64 cycles_late) { + preemption_event = + Core::Timing::CreateEvent("PreemptionCallback", [this](u64 userdata, s64 cycles_late) { global_scheduler.PreemptThreads(); s64 time_interval = Core::Timing::msToCycles(std::chrono::milliseconds(10)); system.CoreTiming().ScheduleEvent(time_interval, preemption_event); @@ -166,8 +166,9 @@ struct KernelCore::Impl { std::shared_ptr<ResourceLimit> system_resource_limit; - Core::Timing::EventType* thread_wakeup_event_type = nullptr; - Core::Timing::EventType* preemption_event = nullptr; + std::shared_ptr<Core::Timing::EventType> thread_wakeup_event_type; + std::shared_ptr<Core::Timing::EventType> preemption_event; + // TODO(yuriks): This can be removed if Thread objects are explicitly pooled in the future, // allowing us to simply use a pool index or similar. Kernel::HandleTable thread_wakeup_callback_handle_table; @@ -269,7 +270,7 @@ u64 KernelCore::CreateNewUserProcessID() { return impl->next_user_process_id++; } -Core::Timing::EventType* KernelCore::ThreadWakeupCallbackEventType() const { +const std::shared_ptr<Core::Timing::EventType>& KernelCore::ThreadWakeupCallbackEventType() const { return impl->thread_wakeup_event_type; } |