[Python-checkins] r66279 - python/branches/release25-maint/Lib/threading.py

gregory.p.smith python-checkins at python.org
Sun Sep 7 03:03:35 CEST 2008


Author: gregory.p.smith
Date: Sun Sep  7 03:03:35 2008
New Revision: 66279

Log:
Backport of r66275/r66274 from trunk/py3k.  This is the last bit of
the fix for issue 874900 to fix the use of the threading module in a
post-fork python process.  A NEWS entry for this already exists with
the previous Lib/threading commit for this bug.


Modified:
   python/branches/release25-maint/Lib/threading.py

Modified: python/branches/release25-maint/Lib/threading.py
==============================================================================
--- python/branches/release25-maint/Lib/threading.py	(original)
+++ python/branches/release25-maint/Lib/threading.py	Sun Sep  7 03:03:35 2008
@@ -781,9 +781,12 @@
     current = currentThread()
     _active_limbo_lock.acquire()
     try:
-        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.


More information about the Python-checkins mailing list