Browse Source

scheduler: Make HaveReadyThreads() a const member function

This function doesn't modify instance state, so the const qualifier can
be added to it.
nce_cpp
Lioncash 7 years ago
parent
commit
6082427cbd
  1. 2
      src/core/hle/kernel/scheduler.cpp
  2. 2
      src/core/hle/kernel/scheduler.h

2
src/core/hle/kernel/scheduler.cpp

@ -25,7 +25,7 @@ Scheduler::~Scheduler() {
}
}
bool Scheduler::HaveReadyThreads() {
bool Scheduler::HaveReadyThreads() const {
std::lock_guard<std::mutex> lock(scheduler_mutex);
return ready_queue.get_first() != nullptr;
}

2
src/core/hle/kernel/scheduler.h

@ -21,7 +21,7 @@ public:
~Scheduler();
/// Returns whether there are any threads that are ready to run.
bool HaveReadyThreads();
bool HaveReadyThreads() const;
/// Reschedules to the next available thread (call after current thread is suspended)
void Reschedule();

Loading…
Cancel
Save