diff options
author | bunnei <bunneidev@gmail.com> | 2022-10-26 18:51:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-26 18:51:44 +0200 |
commit | 2dd6a2352d030230f08b045a21e529ea8f06cf97 (patch) | |
tree | 912bff09ece8da0ade954056bf9ecb3e6ddee673 /src/core/hle/kernel/global_scheduler_context.cpp | |
parent | Merge pull request #9131 from Morph1984/contiguous (diff) | |
parent | kernel: refactor dummy thread wakeups (diff) | |
download | yuzu-2dd6a2352d030230f08b045a21e529ea8f06cf97.tar yuzu-2dd6a2352d030230f08b045a21e529ea8f06cf97.tar.gz yuzu-2dd6a2352d030230f08b045a21e529ea8f06cf97.tar.bz2 yuzu-2dd6a2352d030230f08b045a21e529ea8f06cf97.tar.lz yuzu-2dd6a2352d030230f08b045a21e529ea8f06cf97.tar.xz yuzu-2dd6a2352d030230f08b045a21e529ea8f06cf97.tar.zst yuzu-2dd6a2352d030230f08b045a21e529ea8f06cf97.zip |
Diffstat (limited to 'src/core/hle/kernel/global_scheduler_context.cpp')
-rw-r--r-- | src/core/hle/kernel/global_scheduler_context.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/core/hle/kernel/global_scheduler_context.cpp b/src/core/hle/kernel/global_scheduler_context.cpp index 65576b8c4..fd911a3a5 100644 --- a/src/core/hle/kernel/global_scheduler_context.cpp +++ b/src/core/hle/kernel/global_scheduler_context.cpp @@ -49,4 +49,26 @@ bool GlobalSchedulerContext::IsLocked() const { return scheduler_lock.IsLockedByCurrentThread(); } +void GlobalSchedulerContext::RegisterDummyThreadForWakeup(KThread* thread) { + ASSERT(IsLocked()); + + woken_dummy_threads.insert(thread); +} + +void GlobalSchedulerContext::UnregisterDummyThreadForWakeup(KThread* thread) { + ASSERT(IsLocked()); + + woken_dummy_threads.erase(thread); +} + +void GlobalSchedulerContext::WakeupWaitingDummyThreads() { + ASSERT(IsLocked()); + + for (auto* thread : woken_dummy_threads) { + thread->DummyThreadEndWait(); + } + + woken_dummy_threads.clear(); +} + } // namespace Kernel |