]> granicus.if.org Git - python/commitdiff
On finalize, don't try to join not started process.
authorFlorent Xicluna <florent.xicluna@gmail.com>
Mon, 8 Mar 2010 11:01:39 +0000 (11:01 +0000)
committerFlorent Xicluna <florent.xicluna@gmail.com>
Mon, 8 Mar 2010 11:01:39 +0000 (11:01 +0000)
Lib/multiprocessing/pool.py

index 2a8fae1c6a62b569caf201965b5619d3cebeca94..8555da965fb02a43210d09208b671dfecf562f8a 100644 (file)
@@ -447,12 +447,10 @@ class Pool(object):
         if pool and hasattr(pool[0], 'terminate'):
             debug('joining pool workers')
             for p in pool:
-                p.join()
-            for w in pool:
-                if w.exitcode is None:
+                if p.is_alive():
                     # worker has not yet exited
-                    debug('cleaning up worker %s' % w.pid)
-                    w.join()
+                    debug('cleaning up worker %d' % p.pid)
+                    p.join()
 
 #
 # Class whose instances are returned by `Pool.apply_async()`