[New-bugs-announce] [issue13502] Documentation for Event.wait return value is either wrong or incomplete
R. David Murray
report at bugs.python.org
Tue Nov 29 21:45:16 CET 2011
New submission from R. David Murray <rdmurray at bitdance.com>:
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.
assignee: docs at python
nosy: docs at python, pitrou, r.david.murray, tim_one
stage: needs patch
title: Documentation for Event.wait return value is either wrong or incomplete
versions: Python 2.7, Python 3.2, Python 3.3
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce