diff options
author | bunnei <bunneidev@gmail.com> | 2021-11-11 07:53:19 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2021-12-07 01:39:17 +0100 |
commit | 4c747611555068817f76e72b2cb9c7af99480d12 (patch) | |
tree | 7aa594de73440c7a1fbf4b837052758299b13f43 /src | |
parent | hle: kernel: KConditionVariable: Various updates & simplifications. (diff) | |
download | yuzu-4c747611555068817f76e72b2cb9c7af99480d12.tar yuzu-4c747611555068817f76e72b2cb9c7af99480d12.tar.gz yuzu-4c747611555068817f76e72b2cb9c7af99480d12.tar.bz2 yuzu-4c747611555068817f76e72b2cb9c7af99480d12.tar.lz yuzu-4c747611555068817f76e72b2cb9c7af99480d12.tar.xz yuzu-4c747611555068817f76e72b2cb9c7af99480d12.tar.zst yuzu-4c747611555068817f76e72b2cb9c7af99480d12.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/core/hle/kernel/k_thread_queue.h | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/src/core/hle/kernel/k_thread_queue.h b/src/core/hle/kernel/k_thread_queue.h index 74e76e7cb..fddf16e8b 100644 --- a/src/core/hle/kernel/k_thread_queue.h +++ b/src/core/hle/kernel/k_thread_queue.h @@ -20,69 +20,6 @@ public: virtual void CancelWait(KThread* waiting_thread, ResultCode wait_result, bool cancel_timer_task); - // Deprecated, will be removed in subsequent commits. -public: - bool IsEmpty() const { - return wait_list.empty(); - } - - KThread::WaiterList::iterator begin() { - return wait_list.begin(); - } - KThread::WaiterList::iterator end() { - return wait_list.end(); - } - - bool SleepThread(KThread* t) { - KScopedSchedulerLock sl{kernel}; - - // If the thread needs terminating, don't enqueue it. - if (t->IsTerminationRequested()) { - return false; - } - - // Set the thread's queue and mark it as waiting. - t->SetSleepingQueue(this); - t->SetState(ThreadState::Waiting); - - // Add the thread to the queue. - wait_list.push_back(*t); - - return true; - } - - void WakeupThread(KThread* t) { - KScopedSchedulerLock sl{kernel}; - - // Remove the thread from the queue. - wait_list.erase(wait_list.iterator_to(*t)); - - // Mark the thread as no longer sleeping. - t->SetState(ThreadState::Runnable); - t->SetSleepingQueue(nullptr); - } - - KThread* WakeupFrontThread() { - KScopedSchedulerLock sl{kernel}; - - if (wait_list.empty()) { - return nullptr; - } else { - // Remove the thread from the queue. - auto it = wait_list.begin(); - KThread* thread = std::addressof(*it); - wait_list.erase(it); - - ASSERT(thread->GetState() == ThreadState::Waiting); - - // Mark the thread as no longer sleeping. - thread->SetState(ThreadState::Runnable); - thread->SetSleepingQueue(nullptr); - - return thread; - } - } - private: KernelCore& kernel; KThread::WaiterList wait_list{}; |