diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2008-09-06 23:04:32 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2008-09-06 23:04:32 (GMT) |
commit | 9fb1aca5d863a2ee3f34417c5018f2797c4c3b01 (patch) | |
tree | c6d3e55905229c35d9345ee07596dfedb8cb3b21 /Lib | |
parent | fe38e44123437c64bb83094f76985351aa96c568 (diff) | |
download | cpython-9fb1aca5d863a2ee3f34417c5018f2797c4c3b01.zip cpython-9fb1aca5d863a2ee3f34417c5018f2797c4c3b01.tar.gz cpython-9fb1aca5d863a2ee3f34417c5018f2797c4c3b01.tar.bz2 |
Backport relevant part of r66274 (in issue #874900).
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/threading.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/threading.py b/Lib/threading.py index 25eb9b6..a776c66 100644 --- a/Lib/threading.py +++ b/Lib/threading.py @@ -847,9 +847,12 @@ def _after_fork(): new_active = {} current = current_thread() with _active_limbo_lock: - for ident, thread in _active.iteritems(): + for thread in _active.itervalues(): if thread is current: - # There is only one active thread. + # There is only one active thread. We reset the ident to + # its new value since it can have changed. + ident = _get_ident() + thread._Thread__ident = ident new_active[ident] = thread else: # All the others are already stopped. |