diff --git a/src/core/libraries/kernel/thread_management.cpp b/src/core/libraries/kernel/thread_management.cpp index ac7c8da8..a2befd4c 100644 --- a/src/core/libraries/kernel/thread_management.cpp +++ b/src/core/libraries/kernel/thread_management.cpp @@ -994,8 +994,8 @@ static void* run_thread(void* arg) { auto* thread = static_cast(arg); Common::SetCurrentThreadName(thread->name.c_str()); auto* linker = Common::Singleton::Instance(); - linker->InitTlsForThread(false); Core::InitializeThreadPatchStack(); + linker->InitTlsForThread(false); void* ret = nullptr; g_pthread_self = thread; pthread_cleanup_push(cleanup_thread, thread); diff --git a/src/core/linker.cpp b/src/core/linker.cpp index 2e242129..4ef62c4a 100644 --- a/src/core/linker.cpp +++ b/src/core/linker.cpp @@ -86,8 +86,8 @@ void Linker::Execute() { // Init primary thread. Common::SetCurrentThreadName("GAME_MainThread"); Libraries::Kernel::pthreadInitSelfMainThread(); - InitTlsForThread(true); InitializeThreadPatchStack(); + InitTlsForThread(true); // Start shared library modules for (auto& m : m_modules) {