Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
1c94ff8b
Commit
1c94ff8b
authored
Apr 11, 2012
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Plain Diff
Improve the threading.Condition docs.
parents
b43ef77e
f6cd9b2d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
Doc/library/threading.rst
Doc/library/threading.rst
+5
-3
No files found.
Doc/library/threading.rst
View file @
1c94ff8b
...
...
@@ -584,12 +584,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:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment