[3.13] gh-132542: Set native thread ID after fork (GH-132701) (GH-134361)

(cherry picked from commit 6b73502313)
This commit is contained in:
Noam Cohen 2025-05-20 20:03:19 +03:00 committed by GitHub
parent bad9f63f6c
commit aebbbaffe8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 32 additions and 0 deletions

View file

@ -932,6 +932,8 @@ class Thread:
# This thread is alive.
self._ident = new_ident
assert self._handle.ident == new_ident
if _HAVE_THREAD_NATIVE_ID:
self._set_native_id()
else:
# Otherwise, the thread is dead, Jim. _PyThread_AfterFork()
# already marked our handle done.