mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
bpo-30966: Add multiprocessing.SimpleQueue.close() (GH-19735)
Add a new close() method to multiprocessing.SimpleQueue to explicitly close the queue. Automerge-Triggered-By: @pitrou
This commit is contained in:
parent
c5c42815ec
commit
9adccc1384
5 changed files with 38 additions and 0 deletions
|
@ -346,6 +346,10 @@ class SimpleQueue(object):
|
|||
else:
|
||||
self._wlock = ctx.Lock()
|
||||
|
||||
def close(self):
|
||||
self._reader.close()
|
||||
self._writer.close()
|
||||
|
||||
def empty(self):
|
||||
return not self._poll()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue