mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[3.14] Fix Queue.shutdown docs for condition to unblock a join (gh-137088) (#141073)
(cherry picked from commit ea06ae5b5e)
Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
This commit is contained in:
parent
9878611f28
commit
12847bfff7
4 changed files with 18 additions and 12 deletions
|
|
@ -236,9 +236,11 @@ def shutdown(self, immediate=False):
|
|||
By default, gets will only raise once the queue is empty. Set
|
||||
'immediate' to True to make gets raise immediately instead.
|
||||
|
||||
All blocked callers of put() and get() will be unblocked. If
|
||||
'immediate', callers of join() are unblocked regardless of
|
||||
the number of unfinished tasks.
|
||||
All blocked callers of put() and get() will be unblocked.
|
||||
|
||||
If 'immediate', the queue is drained and unfinished tasks
|
||||
is reduced by the number of drained tasks. If unfinished tasks
|
||||
is reduced to zero, callers of Queue.join are unblocked.
|
||||
'''
|
||||
with self.mutex:
|
||||
self.is_shutdown = True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue