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 r.david.murray
Recipients docs@python, pitrou, r.david.murray, tim.peters
Date 2011-11-29.20:45:15
SpamBayes Score 3.7242154e-07
Marked as misclassified No
Message-id <1322599516.14.0.0239672713193.issue13502@psf.upfronthosting.co.za>
In-reply-to
Content
The documentation for Event.wait says:

  This method returns the internal flag on exit, so it will always return True except if a timeout is given and the operation times out.

In fact, however, if the thread that sets the flag immediately clears it, wait will return False.  Antoine looking at the code says that this appears to be intentional, and that would make sense since originally wait returned no value.

My use case is one thread waiting on another to complete a work loop.  Normally the worker thread goes to sleep after clearing the flag, but sometimes it immediately starts a new work loop.  In either case I want the monitoring loop to take an action when the work loop completes, and raise an error if the wait times out.  It looked to me like Event.wait would work in the scenario.
History
Date User Action Args
2011-11-29 20:45:16r.david.murraysetrecipients: + r.david.murray, tim.peters, pitrou, docs@python
2011-11-29 20:45:16r.david.murraysetmessageid: <1322599516.14.0.0239672713193.issue13502@psf.upfronthosting.co.za>
2011-11-29 20:45:15r.david.murraylinkissue13502 messages
2011-11-29 20:45:15r.david.murraycreate