Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f6cd9b2

Browse files
committed
Improve the threading.Condition docs.
1 parent 2c58075 commit f6cd9b2

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

Doc/library/threading.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -561,12 +561,14 @@ producer-consumer situation with unlimited buffer capacity::
561561
# Produce one item
562562
with cv:
563563
make_an_item_available()
564+
cv.notify()
564565

565566
The ``while`` loop checking for the application's condition is necessary
566567
because :meth:`~Condition.wait` can return after an arbitrary long time,
567-
and other threads may have exhausted the available items in between. This
568-
is inherent to multi-threaded programming. The :meth:`~Condition.wait_for`
569-
method can be used to automate the condition checking::
568+
and the condition which prompted the :meth:`~Condition.notify` call may
569+
no longer hold true. This is inherent to multi-threaded programming. The
570+
:meth:`~Condition.wait_for` method can be used to automate the condition
571+
checking, and eases the computation of timeouts::
570572

571573
# Consume an item
572574
with cv:

0 commit comments

Comments
 (0)