From: Antoine Pitrou Date: Wed, 11 Apr 2012 17:37:56 +0000 (+0200) Subject: Improve the threading.Condition docs. X-Git-Tag: v3.3.0a3~256^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f6cd9b2d46ca5701a20a9cecbe8aba7ae9cc21bd;p=python Improve the threading.Condition docs. --- diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst index 8571104c4c..30f7ece6d3 100644 --- a/Doc/library/threading.rst +++ b/Doc/library/threading.rst @@ -561,12 +561,14 @@ producer-consumer situation with unlimited buffer capacity:: # Produce one item with cv: make_an_item_available() + cv.notify() The ``while`` loop checking for the application's condition is necessary because :meth:`~Condition.wait` can return after an arbitrary long time, -and other threads may have exhausted the available items in between. This -is inherent to multi-threaded programming. The :meth:`~Condition.wait_for` -method can be used to automate the condition checking:: +and the condition which prompted the :meth:`~Condition.notify` call may +no longer hold true. This is inherent to multi-threaded programming. The +:meth:`~Condition.wait_for` method can be used to automate the condition +checking, and eases the computation of timeouts:: # Consume an item with cv: