[PR #4070] [MERGED] threads: initialize tls on thread creation (take 2) #3919

Closed
opened 2026-02-27 22:05:27 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/4070
Author: @roamic
Created: 2/23/2026
Status: Merged
Merged: 2/24/2026
Merged by: @roamic

Base: mainHead: init-tls-on-create


📝 Commits (3)

  • 0f84f6d threads: initialize tls on thread creation (take 2)
  • 8b7a2d2 clear main thread stack before execution
  • 1f09559 don't clear user stack

📊 Changes

17 files changed (+95 additions, -69 deletions)

View changed files

📝 src/core/libraries/avplayer/avplayer_impl.cpp (+8 -8)
📝 src/core/libraries/avplayer/avplayer_state.cpp (+1 -1)
📝 src/core/libraries/ime/ime.cpp (+4 -4)
📝 src/core/libraries/ime/ime_dialog_ui.cpp (+2 -3)
📝 src/core/libraries/kernel/threads.cpp (+11 -0)
📝 src/core/libraries/kernel/threads.h (+3 -0)
📝 src/core/libraries/kernel/threads/exception.cpp (+1 -1)
📝 src/core/libraries/kernel/threads/pthread.cpp (+9 -2)
📝 src/core/libraries/kernel/threads/pthread_spec.cpp (+1 -1)
📝 src/core/libraries/network/net_ctl_obj.cpp (+2 -2)
📝 src/core/libraries/ngs2/ngs2.cpp (+2 -2)
📝 src/core/libraries/usbd/emulated/dimensions.cpp (+41 -14)
📝 src/core/libraries/usbd/emulated/dimensions.h (+2 -0)
📝 src/core/linker.cpp (+5 -5)
📝 src/core/module.cpp (+1 -1)
📝 src/core/tls.cpp (+1 -1)
📝 src/core/tls.h (+1 -24)

📄 Description

Needs testing with the games that were affected by the first attempt:

  • Nier Automata (demo and full)
  • Cyberdimension Neptunia: 4 Goddesses Online
  • TOKYO GHOUL
  • Nioh

And generally any other game


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/4070 **Author:** [@roamic](https://github.com/roamic) **Created:** 2/23/2026 **Status:** ✅ Merged **Merged:** 2/24/2026 **Merged by:** [@roamic](https://github.com/roamic) **Base:** `main` ← **Head:** `init-tls-on-create` --- ### 📝 Commits (3) - [`0f84f6d`](https://github.com/shadps4-emu/shadPS4/commit/0f84f6d9a1e2594b901fba08d20d1a018dfbae39) threads: initialize tls on thread creation (take 2) - [`8b7a2d2`](https://github.com/shadps4-emu/shadPS4/commit/8b7a2d2b30a6bca6539b7f1bf950e502853966b5) clear main thread stack before execution - [`1f09559`](https://github.com/shadps4-emu/shadPS4/commit/1f0955939d61d0beb58e9f69ab7de7583fd86b59) don't clear user stack ### 📊 Changes **17 files changed** (+95 additions, -69 deletions) <details> <summary>View changed files</summary> 📝 `src/core/libraries/avplayer/avplayer_impl.cpp` (+8 -8) 📝 `src/core/libraries/avplayer/avplayer_state.cpp` (+1 -1) 📝 `src/core/libraries/ime/ime.cpp` (+4 -4) 📝 `src/core/libraries/ime/ime_dialog_ui.cpp` (+2 -3) 📝 `src/core/libraries/kernel/threads.cpp` (+11 -0) 📝 `src/core/libraries/kernel/threads.h` (+3 -0) 📝 `src/core/libraries/kernel/threads/exception.cpp` (+1 -1) 📝 `src/core/libraries/kernel/threads/pthread.cpp` (+9 -2) 📝 `src/core/libraries/kernel/threads/pthread_spec.cpp` (+1 -1) 📝 `src/core/libraries/network/net_ctl_obj.cpp` (+2 -2) 📝 `src/core/libraries/ngs2/ngs2.cpp` (+2 -2) 📝 `src/core/libraries/usbd/emulated/dimensions.cpp` (+41 -14) 📝 `src/core/libraries/usbd/emulated/dimensions.h` (+2 -0) 📝 `src/core/linker.cpp` (+5 -5) 📝 `src/core/module.cpp` (+1 -1) 📝 `src/core/tls.cpp` (+1 -1) 📝 `src/core/tls.h` (+1 -24) </details> ### 📄 Description Needs testing with the games that were affected by the first attempt: * Nier Automata (demo and full) * Cyberdimension Neptunia: 4 Goddesses Online * TOKYO GHOUL * Nioh And generally any other game --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 22:05:27 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#3919
No description provided.