Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-102512: Fix threading after os.fork() called from a foreign thread #113261

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Dec 18, 2023

Based on #102517. It recreates a _DummyThread as _MainThread after fork.

marmarek and others added 5 commits March 8, 2023 00:13
If os.fork() is called from a DummyThread (a thread started not by the
threading module, in which somebody called threading.current_thread()),
it becomes main thread. Threading shutdown logic relies on the main
thread having tstate_lock, so initialize it for the DummyThread too.

Fixes python#102512
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants