mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2026-04-25 15:56:00 +03:00
[PR #4048] [MERGED] threads: initialize TLS on thread creation #3896
Labels
No labels
Bloodborne
bug
contributor wanted
documentation
enhancement
frontend
good first issue
help wanted
linux
pull-request
question
release
verification progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/shadPS4#3896
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/shadps4-emu/shadPS4/pull/4048
Author: @roamic
Created: 2/18/2026
Status: ✅ Merged
Merged: 2/19/2026
Merged by: @roamic
Base:
main← Head:init-thread-on-create📝 Commits (4)
781e44dinitialize TLS on thread creationf8fb5bcinitializa tls in dimensions toypad writer thread05e870aclear stack on thread init5677f1eclear most of the stack with some black magic📊 Changes
12 files changed (+52 additions, -51 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/pthread.cpp(+21 -1)📝
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(+4 -0)📝
src/core/linker.cpp(+5 -5)📝
src/core/module.cpp(+2 -1)📝
src/core/tls.h(+0 -23)📄 Description
I'm not sure why this was like this before, but I assume the code in
ExecuteGuestjust initialized the TLS once per thread. I think this can be done on thread start instead of delaying it to the first guest call. This removes the need for stack cleanup hack.I've tested this with Catherine and GR2
Let me know if this breaks something or has a potential to.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.