diff options
author | Brett Cannon <brett@python.org> | 2012-03-06 20:33:24 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2012-03-06 20:33:24 (GMT) |
commit | f67e494ca8dfc72c0f812ed46c6a08ad3b9ddc24 (patch) | |
tree | ceed84488164142e5884411566de19f66702c3e7 /Lib/concurrent/futures/process.py | |
parent | 0d4d410b2d6891520b1772a85f5ebdf926a0c77e (diff) | |
parent | 0119e4753eec50f671ee716af202b4a1ca28deef (diff) | |
download | cpython-f67e494ca8dfc72c0f812ed46c6a08ad3b9ddc24.zip cpython-f67e494ca8dfc72c0f812ed46c6a08ad3b9ddc24.tar.gz cpython-f67e494ca8dfc72c0f812ed46c6a08ad3b9ddc24.tar.bz2 |
merge
Diffstat (limited to 'Lib/concurrent/futures/process.py')
-rw-r--r-- | Lib/concurrent/futures/process.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Lib/concurrent/futures/process.py b/Lib/concurrent/futures/process.py index 7f31ec2..04238a7 100644 --- a/Lib/concurrent/futures/process.py +++ b/Lib/concurrent/futures/process.py @@ -50,7 +50,8 @@ import os from concurrent.futures import _base import queue import multiprocessing -from multiprocessing.queues import SimpleQueue, SentinelReady, Full +from multiprocessing.queues import SimpleQueue, Full +from multiprocessing.connection import wait import threading import weakref @@ -212,6 +213,8 @@ def _queue_management_worker(executor_reference, for p in processes.values(): p.join() + reader = result_queue._reader + while True: _add_call_item_to_queue(pending_work_items, work_ids_queue, @@ -219,9 +222,10 @@ def _queue_management_worker(executor_reference, sentinels = [p.sentinel for p in processes.values()] assert sentinels - try: - result_item = result_queue.get(sentinels=sentinels) - except SentinelReady: + ready = wait([reader] + sentinels) + if reader in ready: + result_item = reader.recv() + else: # Mark the process pool broken so that submits fail right now. executor = executor_reference() if executor is not None: |