Message98031
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 |
|
Date |
User |
Action |
Args |
2010-01-18 20:40:09 | cwalther | set | recipients:
+ cwalther, brett.cannon, gregory.p.smith, amaury.forgeotdarc, Rhamphoryncus, brian.curtin |
2010-01-18 20:40:09 | cwalther | set | messageid: <1263847209.29.0.854125082814.issue1596321@psf.upfronthosting.co.za> |
2010-01-18 20:40:08 | cwalther | link | issue1596321 messages |
2010-01-18 20:40:00 | cwalther | create | |
|