summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/thread_queue_list.h10
-rw-r--r--src/core/hle/kernel/scheduler.cpp2
-rw-r--r--src/core/hle/kernel/scheduler.h2
3 files changed, 7 insertions, 7 deletions
diff --git a/src/common/thread_queue_list.h b/src/common/thread_queue_list.h
index 38a450d69..133122c5f 100644
--- a/src/common/thread_queue_list.h
+++ b/src/common/thread_queue_list.h
@@ -16,7 +16,7 @@ struct ThreadQueueList {
16 // (dynamically resizable) circular buffers to remove their overhead when 16 // (dynamically resizable) circular buffers to remove their overhead when
17 // inserting and popping. 17 // inserting and popping.
18 18
19 typedef unsigned int Priority; 19 using Priority = unsigned int;
20 20
21 // Number of priority levels. (Valid levels are [0..NUM_QUEUES).) 21 // Number of priority levels. (Valid levels are [0..NUM_QUEUES).)
22 static const Priority NUM_QUEUES = N; 22 static const Priority NUM_QUEUES = N;
@@ -26,9 +26,9 @@ struct ThreadQueueList {
26 } 26 }
27 27
28 // Only for debugging, returns priority level. 28 // Only for debugging, returns priority level.
29 Priority contains(const T& uid) { 29 Priority contains(const T& uid) const {
30 for (Priority i = 0; i < NUM_QUEUES; ++i) { 30 for (Priority i = 0; i < NUM_QUEUES; ++i) {
31 Queue& cur = queues[i]; 31 const Queue& cur = queues[i];
32 if (std::find(cur.data.cbegin(), cur.data.cend(), uid) != cur.data.cend()) { 32 if (std::find(cur.data.cbegin(), cur.data.cend(), uid) != cur.data.cend()) {
33 return i; 33 return i;
34 } 34 }
@@ -37,8 +37,8 @@ struct ThreadQueueList {
37 return -1; 37 return -1;
38 } 38 }
39 39
40 T get_first() { 40 T get_first() const {
41 Queue* cur = first; 41 const Queue* cur = first;
42 while (cur != nullptr) { 42 while (cur != nullptr) {
43 if (!cur->data.empty()) { 43 if (!cur->data.empty()) {
44 return cur->data.front(); 44 return cur->data.front();
diff --git a/src/core/hle/kernel/scheduler.cpp b/src/core/hle/kernel/scheduler.cpp
index 94065c736..e770b9103 100644
--- a/src/core/hle/kernel/scheduler.cpp
+++ b/src/core/hle/kernel/scheduler.cpp
@@ -25,7 +25,7 @@ Scheduler::~Scheduler() {
25 } 25 }
26} 26}
27 27
28bool Scheduler::HaveReadyThreads() { 28bool Scheduler::HaveReadyThreads() const {
29 std::lock_guard<std::mutex> lock(scheduler_mutex); 29 std::lock_guard<std::mutex> lock(scheduler_mutex);
30 return ready_queue.get_first() != nullptr; 30 return ready_queue.get_first() != nullptr;
31} 31}
diff --git a/src/core/hle/kernel/scheduler.h b/src/core/hle/kernel/scheduler.h
index 1a4ee8f36..6a61ef64e 100644
--- a/src/core/hle/kernel/scheduler.h
+++ b/src/core/hle/kernel/scheduler.h
@@ -21,7 +21,7 @@ public:
21 ~Scheduler(); 21 ~Scheduler();
22 22
23 /// Returns whether there are any threads that are ready to run. 23 /// Returns whether there are any threads that are ready to run.
24 bool HaveReadyThreads(); 24 bool HaveReadyThreads() const;
25 25
26 /// Reschedules to the next available thread (call after current thread is suspended) 26 /// Reschedules to the next available thread (call after current thread is suspended)
27 void Reschedule(); 27 void Reschedule();