Index: dist/src/Doc/lib/libthreading.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libthreading.tex,v retrieving revision 1.20 diff -u -3 -p -u -r1.20 libthreading.tex --- dist/src/Doc/lib/libthreading.tex 17 Jul 2004 13:35:43 -0000 1.20 +++ dist/src/Doc/lib/libthreading.tex 3 Apr 2005 19:01:12 -0000 @@ -263,7 +263,8 @@ The \method{wait()} method releases the is awakened by a \method{notify()} or \method{notifyAll()} call for the same condition variable in another thread. Once awakened, it re-acquires the lock and returns. It is also possible to specify a -timeout. +timeout. If the wait call reached the timeout time, it returns false, +otherwise return true, indicating that we returned due to notification. The \method{notify()} method wakes up one of the threads waiting for the condition variable, if any are waiting. The \method{notifyAll()} Index: dist/src/Lib/threading.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/threading.py,v retrieving revision 1.48 diff -u -3 -p -u -r1.48 threading.py --- dist/src/Lib/threading.py 27 Jan 2005 22:48:30 -0000 1.48 +++ dist/src/Lib/threading.py 3 Apr 2005 19:01:12 -0000 @@ -198,6 +198,7 @@ class _Condition(_Verbose): waiter.acquire() self.__waiters.append(waiter) saved_state = self._release_save() + notified = True try: # restore state no matter what (e.g., KeyboardInterrupt) if timeout is None: waiter.acquire() @@ -217,6 +218,9 @@ class _Condition(_Verbose): break remaining = endtime - _time() if remaining <= 0: + # return False if we exit on timeout + # (same as boost.thread) + notified = False break delay = min(delay * 2, remaining, .05) _sleep(delay) @@ -232,6 +236,7 @@ class _Condition(_Verbose): self._note("%s.wait(%s): got it", self, timeout) finally: self._acquire_restore(saved_state) + return notified def notify(self, n=1): assert self._is_owned(), "notify() of un-acquire()d lock"