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:
Victor Stinner 2020-04-27 18:11:10 +02:00 committed by GitHub
parent c5c42815ec
commit 9adccc1384
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 38 additions and 0 deletions

View file

@ -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()