diff options
author | bunnei <bunneidev@gmail.com> | 2020-12-05 08:47:59 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2020-12-06 09:27:13 +0100 |
commit | 357d79fb6e6ec0d373d8768f1ee32eebe02e55da (patch) | |
tree | 5cc9669aaf49852ab936512b143c8997635bb911 /src/core | |
parent | common: BitSet: Various style fixes based on code review feedback. (diff) | |
download | yuzu-357d79fb6e6ec0d373d8768f1ee32eebe02e55da.tar yuzu-357d79fb6e6ec0d373d8768f1ee32eebe02e55da.tar.gz yuzu-357d79fb6e6ec0d373d8768f1ee32eebe02e55da.tar.bz2 yuzu-357d79fb6e6ec0d373d8768f1ee32eebe02e55da.tar.lz yuzu-357d79fb6e6ec0d373d8768f1ee32eebe02e55da.tar.xz yuzu-357d79fb6e6ec0d373d8768f1ee32eebe02e55da.tar.zst yuzu-357d79fb6e6ec0d373d8768f1ee32eebe02e55da.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/kernel/global_scheduler_context.cpp | 7 | ||||
-rw-r--r-- | src/core/hle/kernel/global_scheduler_context.h | 8 |
2 files changed, 10 insertions, 5 deletions
diff --git a/src/core/hle/kernel/global_scheduler_context.cpp b/src/core/hle/kernel/global_scheduler_context.cpp index a9cb48b38..a133e8ed0 100644 --- a/src/core/hle/kernel/global_scheduler_context.cpp +++ b/src/core/hle/kernel/global_scheduler_context.cpp @@ -31,7 +31,12 @@ void GlobalSchedulerContext::RemoveThread(std::shared_ptr<Thread> thread) { void GlobalSchedulerContext::PreemptThreads() { // The priority levels at which the global scheduler preempts threads every 10 ms. They are // ordered from Core 0 to Core 3. - std::array<u32, Core::Hardware::NUM_CPU_CORES> preemption_priorities = {59, 59, 59, 63}; + static constexpr std::array<u32, Core::Hardware::NUM_CPU_CORES> preemption_priorities{ + 59, + 59, + 59, + 63, + }; ASSERT(IsLocked()); for (u32 core_id = 0; core_id < Core::Hardware::NUM_CPU_CORES; core_id++) { diff --git a/src/core/hle/kernel/global_scheduler_context.h b/src/core/hle/kernel/global_scheduler_context.h index c4bc23eed..5c7b89290 100644 --- a/src/core/hle/kernel/global_scheduler_context.h +++ b/src/core/hle/kernel/global_scheduler_context.h @@ -21,7 +21,7 @@ class SchedulerLock; using KSchedulerPriorityQueue = KPriorityQueue<Thread, Core::Hardware::NUM_CPU_CORES, THREADPRIO_LOWEST, THREADPRIO_HIGHEST>; -static constexpr s32 HighestCoreMigrationAllowedPriority = 2; +constexpr s32 HighestCoreMigrationAllowedPriority = 2; class GlobalSchedulerContext final { friend class KScheduler; @@ -39,7 +39,7 @@ public: void RemoveThread(std::shared_ptr<Thread> thread); /// Returns a list of all threads managed by the scheduler - const std::vector<std::shared_ptr<Thread>>& GetThreadList() const { + [[nodiscard]] const std::vector<std::shared_ptr<Thread>>& GetThreadList() const { return thread_list; } @@ -55,11 +55,11 @@ public: /// Returns true if the global scheduler lock is acquired bool IsLocked() const; - LockType& SchedulerLock() { + [[nodiscard]] LockType& SchedulerLock() { return scheduler_lock; } - const LockType& SchedulerLock() const { + [[nodiscard]] const LockType& SchedulerLock() const { return scheduler_lock; } |