Skip to content

Commit f7f6623

Browse files
committed
Re-write the threading.Event.wait method more completely
1 parent a34a9b7 commit f7f6623

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

Doc/library/threading.rst

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -987,17 +987,15 @@ method. The :meth:`~Event.wait` method blocks until the flag is true.
987987

988988
.. method:: wait(timeout=None)
989989

990-
Block until the internal flag is true. If the internal flag is true on
991-
entry, return immediately. Otherwise, block until another thread calls
992-
:meth:`.set` to set the flag to true, or until the optional timeout occurs.
990+
Block as long as the internal flag is false and the timeout, if given,
991+
has not expired. The return value represents the
992+
reason that this blocking method returned; ``True`` if returning because
993+
the internal flag is set to true, or ``False`` if a timeout is given and
994+
the the internal flag did not become true within the given wait time.
993995

994996
When the timeout argument is present and not ``None``, it should be a
995-
floating point number specifying a timeout for the operation in seconds
996-
(or fractions thereof).
997-
998-
This method returns ``True`` if and only if the internal flag has been set to
999-
true, either before the wait call or after the wait starts.
1000-
If a timeout is given and the operation times out, ``False`` will be returned.
997+
floating point number specifying a timeout for the operation in seconds,
998+
or fractions thereof.
1001999

10021000
.. versionchanged:: 3.1
10031001
Previously, the method always returned ``None``.

0 commit comments

Comments
 (0)