From 5b7cf50a7760ea1d4202ac3890cefc8934ac841f Mon Sep 17 00:00:00 2001 From: bunnei Date: Mon, 9 Jun 2014 22:08:49 -0400 Subject: [PATCH] Thread: Cleaned up VerifyWait, fixed issue where nullptr msg could unnecessarily be logged. --- src/core/hle/kernel/thread.cpp | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index ebe308a936..baa9687cb9 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -143,16 +143,14 @@ void ChangeReadyState(Thread* t, bool ready) { } /// Verify that a thread has not been released from waiting -inline bool VerifyWait(const Handle& thread, WaitType type, Handle handle) { - Handle wait_id = 0; - Thread* t = g_object_pool.GetFast(thread); - if (t != nullptr && type == t->wait_type && handle == t->wait_handle) { - return true; - } else { - ERROR_LOG(KERNEL, "thread 0x%08X does not exist", thread); +inline bool VerifyWait(const Handle& handle, WaitType type, Handle wait_handle) { + Thread* thread = g_object_pool.GetFast(handle); + _assert_msg_(KERNEL, (thread != nullptr), "called, but thread is nullptr!"); + + if (type != thread->wait_type || wait_handle != thread->wait_handle) return false; - } - return false; + + return true; } /// Stops the current thread