]> granicus.if.org Git - python/commitdiff
Remove calls to currentThread() in _Condition methods that were side-effect.
authorBrett Cannon <bcannon@gmail.com>
Mon, 8 Mar 2004 22:18:57 +0000 (22:18 +0000)
committerBrett Cannon <bcannon@gmail.com>
Mon, 8 Mar 2004 22:18:57 +0000 (22:18 +0000)
Side-effects were deemed unnecessary and were causing problems at shutdown
time when threads were catching exceptions at start time and then triggering
exceptions trying to call currentThread() after gc'ed.  Masked the initial
exception which was deemed bad.

Fixes bug #754449 .

Lib/threading.py

index 6461adc47bd29cc1654c318980509653573ab283..ec955c23cc0611393157bd6f885385f5e25ca7fd 100644 (file)
@@ -193,7 +193,6 @@ class _Condition(_Verbose):
             return True
 
     def wait(self, timeout=None):
-        currentThread() # for side-effect
         assert self._is_owned(), "wait() of un-acquire()d lock"
         waiter = _allocate_lock()
         waiter.acquire()
@@ -235,7 +234,6 @@ class _Condition(_Verbose):
             self._acquire_restore(saved_state)
 
     def notify(self, n=1):
-        currentThread() # for side-effect
         assert self._is_owned(), "notify() of un-acquire()d lock"
         __waiters = self.__waiters
         waiters = __waiters[:n]