summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2010-03-08 11:01:39 (GMT)
committerFlorent Xicluna <florent.xicluna@gmail.com>2010-03-08 11:01:39 (GMT)
commitd034b32f57013a1224b3b7c27789f7c285047011 (patch)
treec5dd4b3b69f423bf7fcd08c84304401c7d3787e2
parentfaf175385de454a99edef26986637fc80c8aaba7 (diff)
downloadcpython-d034b32f57013a1224b3b7c27789f7c285047011.zip
cpython-d034b32f57013a1224b3b7c27789f7c285047011.tar.gz
cpython-d034b32f57013a1224b3b7c27789f7c285047011.tar.bz2
On finalize, don't try to join not started process.
-rw-r--r--Lib/multiprocessing/pool.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/Lib/multiprocessing/pool.py b/Lib/multiprocessing/pool.py
index 2a8fae1..8555da9 100644
--- a/Lib/multiprocessing/pool.py
+++ b/Lib/multiprocessing/pool.py
@@ -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()`