bpo-32576: use queue.SimpleQueue in critical places (#5216)

Where a queue may be invoked from a weakref callback, we need
to use the reentrant SimpleQueue.
This commit is contained in:
Antoine Pitrou 2018-01-18 10:38:03 +01:00 committed by GitHub
parent 6027802ca7
commit ab74504346
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 9 deletions

View file

@ -128,7 +128,7 @@ class ThreadPoolExecutor(_base.Executor):
raise TypeError("initializer must be a callable")
self._max_workers = max_workers
self._work_queue = queue.Queue()
self._work_queue = queue.SimpleQueue()
self._threads = set()
self._broken = False
self._shutdown = False