From c3c43e32fcf198444acb493483e03fcb193156df Mon Sep 17 00:00:00 2001 From: bunnei Date: Mon, 28 Dec 2020 13:16:43 -0800 Subject: hle: kernel: thread: Replace ThreadStatus/ThreadSchedStatus with a single ThreadState. - This is how the real kernel works, and is more accurate and simpler. --- src/core/hle/kernel/k_synchronization_object.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/core/hle/kernel/k_synchronization_object.cpp') diff --git a/src/core/hle/kernel/k_synchronization_object.cpp b/src/core/hle/kernel/k_synchronization_object.cpp index e7fd119d8..64c566caa 100644 --- a/src/core/hle/kernel/k_synchronization_object.cpp +++ b/src/core/hle/kernel/k_synchronization_object.cpp @@ -77,7 +77,7 @@ ResultCode KSynchronizationObject::Wait(KernelCore& kernel, s32* out_index, // Mark the thread as waiting. thread->SetCancellable(); thread->SetSyncedObject(nullptr, Svc::ResultTimedOut); - thread->SetState(ThreadState::WaitSynch); + thread->SetState(ThreadState::Waiting); } // The lock/sleep is done, so we should be able to get our result. @@ -148,9 +148,9 @@ void KSynchronizationObject::NotifyAvailable(ResultCode result) { // Iterate over each thread. for (auto* cur_node = thread_list_head; cur_node != nullptr; cur_node = cur_node->next) { Thread* thread = cur_node->thread; - if (thread->GetState() == ThreadSchedStatus::Paused) { + if (thread->GetState() == ThreadState::Waiting) { thread->SetSyncedObject(this, result); - thread->SetState(ThreadStatus::Ready); + thread->SetState(ThreadState::Runnable); } } } -- cgit v1.2.3