mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #13502: threading: Fix a race condition in Event.wait() that made it
return False when the event was set and cleared right after.
This commit is contained in:
commit
61d28d6a74
4 changed files with 27 additions and 5 deletions
|
@ -804,8 +804,10 @@ An event object manages an internal flag that can be set to true with the
|
|||
floating point number specifying a timeout for the operation in seconds
|
||||
(or fractions thereof).
|
||||
|
||||
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.
|
||||
This method returns true if and only if the internal flag has been set to
|
||||
true, either before the wait call or after the wait starts, so it will
|
||||
always return ``True`` except if a timeout is given and the operation
|
||||
times out.
|
||||
|
||||
.. versionchanged:: 3.1
|
||||
Previously, the method always returned ``None``.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue