diff options
author | Liam <byteslice@airmail.cc> | 2023-03-07 01:45:40 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2023-03-13 03:06:53 +0100 |
commit | d24ab14126a761ae40ce5d4964083390f1d7b396 (patch) | |
tree | 2658ea0b5078404676df31f01042c523cf824c8b /src/core/hle/kernel/global_scheduler_context.h | |
parent | Merge pull request #9942 from liamwhite/speling (diff) | |
download | yuzu-d24ab14126a761ae40ce5d4964083390f1d7b396.tar yuzu-d24ab14126a761ae40ce5d4964083390f1d7b396.tar.gz yuzu-d24ab14126a761ae40ce5d4964083390f1d7b396.tar.bz2 yuzu-d24ab14126a761ae40ce5d4964083390f1d7b396.tar.lz yuzu-d24ab14126a761ae40ce5d4964083390f1d7b396.tar.xz yuzu-d24ab14126a761ae40ce5d4964083390f1d7b396.tar.zst yuzu-d24ab14126a761ae40ce5d4964083390f1d7b396.zip |
Diffstat (limited to 'src/core/hle/kernel/global_scheduler_context.h')
-rw-r--r-- | src/core/hle/kernel/global_scheduler_context.h | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/src/core/hle/kernel/global_scheduler_context.h b/src/core/hle/kernel/global_scheduler_context.h index 220ed6192..b7fb8caec 100644 --- a/src/core/hle/kernel/global_scheduler_context.h +++ b/src/core/hle/kernel/global_scheduler_context.h @@ -33,7 +33,7 @@ class GlobalSchedulerContext final { public: using LockType = KAbstractSchedulerLock<KScheduler>; - explicit GlobalSchedulerContext(KernelCore& kernel_); + explicit GlobalSchedulerContext(KernelCore& kernel); ~GlobalSchedulerContext(); /// Adds a new thread to the scheduler @@ -43,8 +43,9 @@ public: void RemoveThread(KThread* thread); /// Returns a list of all threads managed by the scheduler + /// This is only safe to iterate while holding the scheduler lock [[nodiscard]] const std::vector<KThread*>& GetThreadList() const { - return thread_list; + return m_thread_list; } /** @@ -64,29 +65,25 @@ public: void WakeupWaitingDummyThreads(); [[nodiscard]] LockType& SchedulerLock() { - return scheduler_lock; - } - - [[nodiscard]] const LockType& SchedulerLock() const { - return scheduler_lock; + return m_scheduler_lock; } private: friend class KScopedSchedulerLock; friend class KScopedSchedulerLockAndSleep; - KernelCore& kernel; + KernelCore& m_kernel; - std::atomic_bool scheduler_update_needed{}; - KSchedulerPriorityQueue priority_queue; - LockType scheduler_lock; + std::atomic_bool m_scheduler_update_needed{}; + KSchedulerPriorityQueue m_priority_queue; + LockType m_scheduler_lock; /// Lists dummy threads pending wakeup on lock release - std::set<KThread*> woken_dummy_threads; + std::set<KThread*> m_woken_dummy_threads; /// Lists all thread ids that aren't deleted/etc. - std::vector<KThread*> thread_list; - std::mutex global_list_guard; + std::vector<KThread*> m_thread_list; + std::mutex m_global_list_guard; }; } // namespace Kernel |