This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author cwalther
Recipients Rhamphoryncus, amaury.forgeotdarc, brett.cannon, brian.curtin, cwalther, gregory.p.smith
Date 2010-01-18.20:40:00
SpamBayes Score 5.1940174e-11
Marked as misclassified No
Message-id <1263847209.29.0.854125082814.issue1596321@psf.upfronthosting.co.za>
In-reply-to
Content
I have the impression we're tracking two completely unrelated problems in this tracker item.

As to "needs patch" regarding my problem: Here's the solution I proposed in my original post in patch form - I'm just not sure if it is correct. I don't recommend applying this until someone who is familiar with the workings of the threading module has confirmed that removing self from _active is the right thing to do (and that what I'm doing is the accepted pythonic way of removing a dictionary entry by value).

Index: Lib/threading.py
===================================================================
--- Lib/threading.py    (revision 77598)
+++ Lib/threading.py    (working copy)
@@ -611,7 +611,11 @@
 
         try:
             with _active_limbo_lock:
-                del _active[_get_ident()]
+                for k, v in _active.iteritems():
+                    if v is self: break
+                else:
+                    assert False, "thread instance not found in _active"
+                del _active[k]
                 # There must not be any python code between the previous line
                 # and after the lock is released.  Otherwise a tracing function
                 # could try to acquire the lock again in the same thread, (in
History
Date User Action Args
2010-01-18 20:40:09cwalthersetrecipients: + cwalther, brett.cannon, gregory.p.smith, amaury.forgeotdarc, Rhamphoryncus, brian.curtin
2010-01-18 20:40:09cwalthersetmessageid: <1263847209.29.0.854125082814.issue1596321@psf.upfronthosting.co.za>
2010-01-18 20:40:08cwaltherlinkissue1596321 messages
2010-01-18 20:40:00cwalthercreate