From d58a609ae43d2a1db296e90cb87dcfa3e4d4e7f3 Mon Sep 17 00:00:00 2001 From: bunnei Date: Sat, 28 Nov 2020 11:54:41 -0800 Subject: hle: kernel: process: Add schedule count tracking, to be used for yield impl. --- src/core/hle/kernel/process.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/core/hle/kernel/process.h') diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h index f45cb5674..36d8547bd 100644 --- a/src/core/hle/kernel/process.h +++ b/src/core/hle/kernel/process.h @@ -216,6 +216,16 @@ public: total_process_running_time_ticks += ticks; } + /// Gets the process schedule count, used for thread yelding + constexpr s64 GetScheduledCount() const { + return schedule_count; + } + + /// Increments the process schedule count, used for thread yielding. + constexpr void IncrementScheduledCount() { + ++schedule_count; + } + /// Gets 8 bytes of random data for svcGetInfo RandomEntropy u64 GetRandomEntropy(std::size_t index) const { return random_entropy.at(index); @@ -397,6 +407,9 @@ private: /// Name of this process std::string name; + /// Schedule count of this process + s64 schedule_count{}; + /// System context Core::System& system; }; -- cgit v1.2.3 From 1bdb756d28a00f168094e490143dba89569fe35a Mon Sep 17 00:00:00 2001 From: bunnei Date: Sun, 6 Dec 2020 00:25:58 -0800 Subject: hle: kernel: Process: Various style fixes based on code review feedback. --- src/core/hle/kernel/process.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core/hle/kernel/process.h') diff --git a/src/core/hle/kernel/process.h b/src/core/hle/kernel/process.h index 36d8547bd..e412e58aa 100644 --- a/src/core/hle/kernel/process.h +++ b/src/core/hle/kernel/process.h @@ -217,12 +217,12 @@ public: } /// Gets the process schedule count, used for thread yelding - constexpr s64 GetScheduledCount() const { + s64 GetScheduledCount() const { return schedule_count; } /// Increments the process schedule count, used for thread yielding. - constexpr void IncrementScheduledCount() { + void IncrementScheduledCount() { ++schedule_count; } -- cgit v1.2.3