Skip to content

Commit 65c9ed2

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

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

Doc/library/threading.rst

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -987,17 +987,16 @@ 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 not
994+
``None`` and the the internal flag did not become true within the given
995+
wait time.
993996

994997
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.
998+
floating point number specifying a timeout for the operation in seconds,
999+
or fractions thereof.
10011000

10021001
.. versionchanged:: 3.1
10031002
Previously, the method always returned ``None``.

0 commit comments

Comments
 (0)