File tree Expand file tree Collapse file tree 4 files changed +18
-12
lines changed Expand file tree Collapse file tree 4 files changed +18
-12
lines changed Original file line number Diff line number Diff line change @@ -120,9 +120,10 @@ Queue
120
120
raise :exc: `QueueShutDown `.
121
121
122
122
If *immediate * is true, the queue is terminated immediately.
123
- The queue is drained to be completely empty. All callers of
124
- :meth: `~Queue.join ` are unblocked regardless of the number
125
- of unfinished tasks. Blocked callers of :meth: `~Queue.get `
123
+ The queue is drained to be completely empty and the count
124
+ of unfinished tasks is reduced by the number of tasks drained.
125
+ If unfinished tasks is zero, callers of :meth: `~Queue.join `
126
+ are unblocked. Also, blocked callers of :meth: `~Queue.get `
126
127
are unblocked and will raise :exc: `QueueShutDown ` because the
127
128
queue is empty.
128
129
Original file line number Diff line number Diff line change @@ -256,9 +256,10 @@ until empty or terminated immediately with a hard shutdown.
256
256
raise :exc: `ShutDown `.
257
257
258
258
If *immediate * is true, the queue is terminated immediately.
259
- The queue is drained to be completely empty. All callers of
260
- :meth: `~Queue.join ` are unblocked regardless of the number
261
- of unfinished tasks. Blocked callers of :meth: `~Queue.get `
259
+ The queue is drained to be completely empty and the count
260
+ of unfinished tasks is reduced by the number of tasks drained.
261
+ If unfinished tasks is zero, callers of :meth: `~Queue.join `
262
+ are unblocked. Also, blocked callers of :meth: `~Queue.get `
262
263
are unblocked and will raise :exc: `ShutDown ` because the
263
264
queue is empty.
264
265
Original file line number Diff line number Diff line change @@ -253,9 +253,11 @@ def shutdown(self, immediate=False):
253
253
By default, gets will only raise once the queue is empty. Set
254
254
'immediate' to True to make gets raise immediately instead.
255
255
256
- All blocked callers of put() and get() will be unblocked. If
257
- 'immediate', unblock callers of join() regardless of the
258
- number of unfinished tasks.
256
+ All blocked callers of put() and get() will be unblocked.
257
+
258
+ If 'immediate', the queue is drained and unfinished tasks
259
+ is reduced by the number of drained tasks. If unfinished tasks
260
+ is reduced to zero, callers of Queue.join are unblocked.
259
261
"""
260
262
self ._is_shutdown = True
261
263
if immediate :
Original file line number Diff line number Diff line change @@ -236,9 +236,11 @@ def shutdown(self, immediate=False):
236
236
By default, gets will only raise once the queue is empty. Set
237
237
'immediate' to True to make gets raise immediately instead.
238
238
239
- All blocked callers of put() and get() will be unblocked. If
240
- 'immediate', callers of join() are unblocked regardless of
241
- the number of unfinished tasks.
239
+ All blocked callers of put() and get() will be unblocked.
240
+
241
+ If 'immediate', the queue is drained and unfinished tasks
242
+ is reduced by the number of drained tasks. If unfinished tasks
243
+ is reduced to zero, callers of Queue.join are unblocked.
242
244
'''
243
245
with self .mutex :
244
246
self .is_shutdown = True
You can’t perform that action at this time.
0 commit comments