diff options
| author | 2019-06-15 10:12:41 -0400 | |
|---|---|---|
| committer | 2019-06-16 14:14:35 -0400 | |
| commit | 90792cdb6ea8f1676bd54309767209a4ec84a46f (patch) | |
| tree | eae330371459c0f9b71fcbf1c68e2fb01d19e294 /src/core/hle/kernel/thread.cpp | |
| parent | Merge pull request #2578 from lioncash/cnmt (diff) | |
| download | yuzu-90792cdb6ea8f1676bd54309767209a4ec84a46f.tar.gz yuzu-90792cdb6ea8f1676bd54309767209a4ec84a46f.tar.xz yuzu-90792cdb6ea8f1676bd54309767209a4ec84a46f.zip | |
Core_Timing: Make core_timing threadsafe by default.
The old implementation had faulty Threadsafe methods where events could
be missing. This implementation unifies unsafe/safe methods and makes
core timing thread safe overall.
Diffstat (limited to 'src/core/hle/kernel/thread.cpp')
| -rw-r--r-- | src/core/hle/kernel/thread.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index c73a40977..a055a5002 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp | |||
| @@ -76,13 +76,13 @@ void Thread::WakeAfterDelay(s64 nanoseconds) { | |||
| 76 | // This function might be called from any thread so we have to be cautious and use the | 76 | // This function might be called from any thread so we have to be cautious and use the |
| 77 | // thread-safe version of ScheduleEvent. | 77 | // thread-safe version of ScheduleEvent. |
| 78 | const s64 cycles = Core::Timing::nsToCycles(std::chrono::nanoseconds{nanoseconds}); | 78 | const s64 cycles = Core::Timing::nsToCycles(std::chrono::nanoseconds{nanoseconds}); |
| 79 | Core::System::GetInstance().CoreTiming().ScheduleEventThreadsafe( | 79 | Core::System::GetInstance().CoreTiming().ScheduleEvent( |
| 80 | cycles, kernel.ThreadWakeupCallbackEventType(), callback_handle); | 80 | cycles, kernel.ThreadWakeupCallbackEventType(), callback_handle); |
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | void Thread::CancelWakeupTimer() { | 83 | void Thread::CancelWakeupTimer() { |
| 84 | Core::System::GetInstance().CoreTiming().UnscheduleEventThreadsafe( | 84 | Core::System::GetInstance().CoreTiming().UnscheduleEvent(kernel.ThreadWakeupCallbackEventType(), |
| 85 | kernel.ThreadWakeupCallbackEventType(), callback_handle); | 85 | callback_handle); |
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | static std::optional<s32> GetNextProcessorId(u64 mask) { | 88 | static std::optional<s32> GetNextProcessorId(u64 mask) { |