summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2008-09-06 23:04:32 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2008-09-06 23:04:32 (GMT)
commit9fb1aca5d863a2ee3f34417c5018f2797c4c3b01 (patch)
treec6d3e55905229c35d9345ee07596dfedb8cb3b21
parentfe38e44123437c64bb83094f76985351aa96c568 (diff)
downloadcpython-9fb1aca5d863a2ee3f34417c5018f2797c4c3b01.zip
cpython-9fb1aca5d863a2ee3f34417c5018f2797c4c3b01.tar.gz
cpython-9fb1aca5d863a2ee3f34417c5018f2797c4c3b01.tar.bz2
Backport relevant part of r66274 (in issue #874900).
-rw-r--r--Lib/threading.py7
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.