mirror of
https://github.com/python/cpython.git
synced 2025-11-12 03:22:06 +00:00
[3.14] Fix docs for Queue.shutdown (gh-137028) (#137080)
Fix docs for Queue.shutdown (gh-137028)
(cherry picked from commit 245671555b)
Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Co-authored-by: Zachary Ware <zach@python.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
08d8dadfc2
commit
98ca0b3e2b
4 changed files with 58 additions and 35 deletions
|
|
@ -227,9 +227,6 @@ def task_done(self):
|
|||
been processed (meaning that a task_done() call was received for every
|
||||
item that had been put() into the queue).
|
||||
|
||||
shutdown(immediate=True) calls task_done() for each remaining item in
|
||||
the queue.
|
||||
|
||||
Raises ValueError if called more times than there were items placed in
|
||||
the queue.
|
||||
"""
|
||||
|
|
@ -257,8 +254,8 @@ def shutdown(self, immediate=False):
|
|||
'immediate' to True to make gets raise immediately instead.
|
||||
|
||||
All blocked callers of put() and get() will be unblocked. If
|
||||
'immediate', a task is marked as done for each item remaining in
|
||||
the queue, which may unblock callers of join().
|
||||
'immediate', unblock callers of join() regardless of the
|
||||
number of unfinished tasks.
|
||||
"""
|
||||
self._is_shutdown = True
|
||||
if immediate:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue