Merge pull request #668 from squidbus/fix-patch-stack
Initialize patch stack before thread TLS.
This commit is contained in:
commit
f1fe6b9f96
|
@ -994,8 +994,8 @@ static void* run_thread(void* arg) {
|
||||||
auto* thread = static_cast<ScePthread>(arg);
|
auto* thread = static_cast<ScePthread>(arg);
|
||||||
Common::SetCurrentThreadName(thread->name.c_str());
|
Common::SetCurrentThreadName(thread->name.c_str());
|
||||||
auto* linker = Common::Singleton<Core::Linker>::Instance();
|
auto* linker = Common::Singleton<Core::Linker>::Instance();
|
||||||
linker->InitTlsForThread(false);
|
|
||||||
Core::InitializeThreadPatchStack();
|
Core::InitializeThreadPatchStack();
|
||||||
|
linker->InitTlsForThread(false);
|
||||||
void* ret = nullptr;
|
void* ret = nullptr;
|
||||||
g_pthread_self = thread;
|
g_pthread_self = thread;
|
||||||
pthread_cleanup_push(cleanup_thread, thread);
|
pthread_cleanup_push(cleanup_thread, thread);
|
||||||
|
|
|
@ -86,8 +86,8 @@ void Linker::Execute() {
|
||||||
// Init primary thread.
|
// Init primary thread.
|
||||||
Common::SetCurrentThreadName("GAME_MainThread");
|
Common::SetCurrentThreadName("GAME_MainThread");
|
||||||
Libraries::Kernel::pthreadInitSelfMainThread();
|
Libraries::Kernel::pthreadInitSelfMainThread();
|
||||||
InitTlsForThread(true);
|
|
||||||
InitializeThreadPatchStack();
|
InitializeThreadPatchStack();
|
||||||
|
InitTlsForThread(true);
|
||||||
|
|
||||||
// Start shared library modules
|
// Start shared library modules
|
||||||
for (auto& m : m_modules) {
|
for (auto& m : m_modules) {
|
||||||
|
|
Loading…
Reference in New Issue