From 4ad69ca96e747c2ed23edf7f35c5fedda28b2008 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 15 Jul 2020 13:13:31 -0400 Subject: kernel/thread: Remove global GetCurrentThread() This is only used in one place, so we can fold it into the calling code, eliminating a place for the global system instance to be used. --- src/core/hle/kernel/handle_table.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/core/hle/kernel/handle_table.cpp') diff --git a/src/core/hle/kernel/handle_table.cpp b/src/core/hle/kernel/handle_table.cpp index 35448b576..aaf048243 100644 --- a/src/core/hle/kernel/handle_table.cpp +++ b/src/core/hle/kernel/handle_table.cpp @@ -8,6 +8,7 @@ #include "core/core.h" #include "core/hle/kernel/errors.h" #include "core/hle/kernel/handle_table.h" +#include "core/hle/kernel/scheduler.h" #include "core/hle/kernel/process.h" #include "core/hle/kernel/thread.h" @@ -103,7 +104,7 @@ bool HandleTable::IsValid(Handle handle) const { std::shared_ptr HandleTable::GetGeneric(Handle handle) const { if (handle == CurrentThread) { - return SharedFrom(GetCurrentThread()); + return SharedFrom(Core::System::GetInstance().CurrentScheduler().GetCurrentThread()); } else if (handle == CurrentProcess) { return SharedFrom(Core::System::GetInstance().CurrentProcess()); } -- cgit v1.2.3