[Python-Dev] second opinion for proposed fix for bug #754449 (original) (raw)

Aahz aahz at pythoncraft.com
Wed Mar 3 04:58:23 EST 2004


On Tue, Mar 02, 2004, Brett C. wrote:

Basically the exception stems from a call to threading.currentThread in the Condition class (which is just Condition) which, according to the comment along with the call, is just for its side-effect. Well, I looked and I can't find the need for the side-effect. I took out the code and ran the regression tests and nothing failed because of it. Since the code says the call is for the explicit side-effect I just wanted another pair of eyes to quickly scan the code in threading.py and either agree with me or tell me I am blind and point out where the side-effect is needed for Condition instances. The offending currentThread calls can be found on lines 196 and 238 (can also just search for "side-effect" to find them).

The only generic side-effect I can see from calling currentThread() (after drilling down to all the .h files for OS-specific stuff) is that if the current thread isn't a thread created by threading, it calls _DummyThread(). Dunno whether this is actually needed, no brainpower to figure that out. Do the regression tests make sure that threading works with threads created by thread?

Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/

"Do not taunt happy fun for loops. Do not change lists you are looping over." --Remco Gerlich, comp.lang.python



More information about the Python-Dev mailing list