diff options
| author | 2021-11-10 22:53:19 -0800 | |
|---|---|---|
| committer | 2021-12-06 16:39:17 -0800 | |
| commit | 4c747611555068817f76e72b2cb9c7af99480d12 (patch) | |
| tree | 7aa594de73440c7a1fbf4b837052758299b13f43 /src/core/hle/kernel | |
| parent | hle: kernel: KConditionVariable: Various updates & simplifications. (diff) | |
| download | yuzu-4c747611555068817f76e72b2cb9c7af99480d12.tar.gz yuzu-4c747611555068817f76e72b2cb9c7af99480d12.tar.xz yuzu-4c747611555068817f76e72b2cb9c7af99480d12.zip | |
hle: kernel: KThreadQueue: Remove deprecated code.
Diffstat (limited to 'src/core/hle/kernel')
| -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: | |||
| 20 | virtual void CancelWait(KThread* waiting_thread, ResultCode wait_result, | 20 | virtual void CancelWait(KThread* waiting_thread, ResultCode wait_result, |
| 21 | bool cancel_timer_task); | 21 | bool cancel_timer_task); |
| 22 | 22 | ||
| 23 | // Deprecated, will be removed in subsequent commits. | ||
| 24 | public: | ||
| 25 | bool IsEmpty() const { | ||
| 26 | return wait_list.empty(); | ||
| 27 | } | ||
| 28 | |||
| 29 | KThread::WaiterList::iterator begin() { | ||
| 30 | return wait_list.begin(); | ||
| 31 | } | ||
| 32 | KThread::WaiterList::iterator end() { | ||
| 33 | return wait_list.end(); | ||
| 34 | } | ||
| 35 | |||
| 36 | bool SleepThread(KThread* t) { | ||
| 37 | KScopedSchedulerLock sl{kernel}; | ||
| 38 | |||
| 39 | // If the thread needs terminating, don't enqueue it. | ||
| 40 | if (t->IsTerminationRequested()) { | ||
| 41 | return false; | ||
| 42 | } | ||
| 43 | |||
| 44 | // Set the thread's queue and mark it as waiting. | ||
| 45 | t->SetSleepingQueue(this); | ||
| 46 | t->SetState(ThreadState::Waiting); | ||
| 47 | |||
| 48 | // Add the thread to the queue. | ||
| 49 | wait_list.push_back(*t); | ||
| 50 | |||
| 51 | return true; | ||
| 52 | } | ||
| 53 | |||
| 54 | void WakeupThread(KThread* t) { | ||
| 55 | KScopedSchedulerLock sl{kernel}; | ||
| 56 | |||
| 57 | // Remove the thread from the queue. | ||
| 58 | wait_list.erase(wait_list.iterator_to(*t)); | ||
| 59 | |||
| 60 | // Mark the thread as no longer sleeping. | ||
| 61 | t->SetState(ThreadState::Runnable); | ||
| 62 | t->SetSleepingQueue(nullptr); | ||
| 63 | } | ||
| 64 | |||
| 65 | KThread* WakeupFrontThread() { | ||
| 66 | KScopedSchedulerLock sl{kernel}; | ||
| 67 | |||
| 68 | if (wait_list.empty()) { | ||
| 69 | return nullptr; | ||
| 70 | } else { | ||
| 71 | // Remove the thread from the queue. | ||
| 72 | auto it = wait_list.begin(); | ||
| 73 | KThread* thread = std::addressof(*it); | ||
| 74 | wait_list.erase(it); | ||
| 75 | |||
| 76 | ASSERT(thread->GetState() == ThreadState::Waiting); | ||
| 77 | |||
| 78 | // Mark the thread as no longer sleeping. | ||
| 79 | thread->SetState(ThreadState::Runnable); | ||
| 80 | thread->SetSleepingQueue(nullptr); | ||
| 81 | |||
| 82 | return thread; | ||
| 83 | } | ||
| 84 | } | ||
| 85 | |||
| 86 | private: | 23 | private: |
| 87 | KernelCore& kernel; | 24 | KernelCore& kernel; |
| 88 | KThread::WaiterList wait_list{}; | 25 | KThread::WaiterList wait_list{}; |