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

Skip to content

Commit 1c94ff8

Browse files
committed
Improve the threading.Condition docs.
2 parents b43ef77 + f6cd9b2 commit 1c94ff8

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
@@ -584,12 +584,14 @@ producer-consumer situation with unlimited buffer capacity::
584584
# Produce one item
585585
with cv:
586586
make_an_item_available()
587+
cv.notify()
587588

588589
The ``while`` loop checking for the application's condition is necessary
589590
because :meth:`~Condition.wait` can return after an arbitrary long time,
590-
and other threads may have exhausted the available items in between. This
591-
is inherent to multi-threaded programming. The :meth:`~Condition.wait_for`
592-
method can be used to automate the condition checking::
591+
and the condition which prompted the :meth:`~Condition.notify` call may
592+
no longer hold true. This is inherent to multi-threaded programming. The
593+
:meth:`~Condition.wait_for` method can be used to automate the condition
594+
checking, and eases the computation of timeouts::
593595

594596
# Consume an item
595597
with cv:

0 commit comments

Comments
 (0)