summaryrefslogtreecommitdiffstats
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2024-01-22 14:14:42 (GMT)
committerGitHub <noreply@github.com>2024-01-22 14:14:42 (GMT)
commit49785b06ded19c7c4afce186bac90fea707470ea (patch)
treee3a0dccafdd64288e4ecf03cef8a84d9a7b854a7 /Python/sysmodule.c
parent9f7176d360b5898003d5ca78bab1822ad67867c4 (diff)
downloadcpython-49785b06ded19c7c4afce186bac90fea707470ea.zip
cpython-49785b06ded19c7c4afce186bac90fea707470ea.tar.gz
cpython-49785b06ded19c7c4afce186bac90fea707470ea.tar.bz2
gh-102512: Turn _DummyThread into _MainThread after os.fork() called from a foreign thread (GH-113261)
Always set a _MainThread as a main thread after os.fork() is called from a thread started not by the threading module. A new _MainThread was already set as a new main thread after fork if threading.current_thread() was not called for a foreign thread before fork. Now, if it was called before fork, the implicitly created _DummyThread will be turned into _MainThread after fork. It fixes, in particularly, an incompatibility of _DummyThread with the threading shutdown logic which relies on the main thread having tstate_lock. Co-authored-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Diffstat (limited to 'Python/sysmodule.c')
0 files changed, 0 insertions, 0 deletions