]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merge with 3.2 for #12364.
authorRoss Lagerwall <rosslagerwall@gmail.com>
Sun, 8 Jan 2012 06:42:03 +0000 (08:42 +0200)
committerRoss Lagerwall <rosslagerwall@gmail.com>
Sun, 8 Jan 2012 06:42:03 +0000 (08:42 +0200)
1  2 
Lib/concurrent/futures/process.py
Lib/test/test_concurrent_futures.py
Misc/NEWS

index 0575146b220b754f9d85af82d8e886f095d9519a,d3bbe2c5e68f5534bb47b97f075c3350e8eee4d8..7f31ec2263badbdd219d7c0688c6958ce623a49f
@@@ -266,21 -219,20 +266,18 @@@ def _queue_management_worker(executor_r
          #   - The interpreter is shutting down OR
          #   - The executor that owns this worker has been collected OR
          #   - The executor that owns this worker has been shutdown.
 -        if _shutdown or executor is None or executor._shutdown_thread:
 -            # Since no new work items can be added, it is safe to shutdown
 -            # this thread if there are no pending work items.
 -            if not pending_work_items:
 -                while nb_shutdown_processes < len(processes):
 -                    shutdown_one_process()
 -                # If .join() is not called on the created processes then
 -                # some multiprocessing.Queue methods may deadlock on Mac OS
 -                # X.
 -                for p in processes:
 -                    p.join()
 -                call_queue.close()
 -                return
 -        del executor
 +        if shutting_down():
 +            try:
 +                # Since no new work items can be added, it is safe to shutdown
 +                # this thread if there are no pending work items.
 +                if not pending_work_items:
 +                    shutdown_worker()
 +                    return
-                 else:
-                     # Start shutting down by telling a process it can exit.
-                     call_queue.put_nowait(None)
 +            except Full:
 +                # This is not a problem: we will eventually be woken up (in
 +                # result_queue.get()) and be able to send a sentinel again.
 +                pass
 +        executor = None
  
  _system_limits_checked = False
  _system_limited = None
Simple merge
diff --cc Misc/NEWS
Simple merge