summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel
diff options
context:
space:
mode:
authorGravatar bunnei2021-11-10 22:53:19 -0800
committerGravatar bunnei2021-12-06 16:39:17 -0800
commit4c747611555068817f76e72b2cb9c7af99480d12 (patch)
tree7aa594de73440c7a1fbf4b837052758299b13f43 /src/core/hle/kernel
parenthle: kernel: KConditionVariable: Various updates & simplifications. (diff)
downloadyuzu-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.h63
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.
24public:
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
86private: 23private:
87 KernelCore& kernel; 24 KernelCore& kernel;
88 KThread::WaiterList wait_list{}; 25 KThread::WaiterList wait_list{};