summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gr?nholm <alex.gronholm@nextday.fi>2012-08-25 06:50:48 +0000
committerAlex Gr?nholm <alex.gronholm@nextday.fi>2012-08-25 06:50:48 +0000
commit4a4b6974a8b6684ecbb429cd947503b6fe78ac39 (patch)
tree20f90544600b5a9c25a1c6c1b0cd46b8b5990b4f
parent75441481c4e5855f18d1772064e6d5f44b2a3730 (diff)
downloadfutures-4a4b6974a8b6684ecbb429cd947503b6fe78ac39.tar.gz
Fixed race condition (thanks Ralf Schmitt)2.1.3
-rw-r--r--CHANGES2
-rw-r--r--concurrent/futures/_base.py3
-rw-r--r--docs/conf.py4
-rwxr-xr-xsetup.py2
4 files changed, 6 insertions, 5 deletions
diff --git a/CHANGES b/CHANGES
index 610c2ec..1a84b63 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,8 @@
2.1.3
=====
+- Fixed race condition in wait(return_when=ALL_COMPLETED)
+ (http://bugs.python.org/issue14406) -- thanks Ralf Schmitt
- Added missing setUp() methods to several test classes
diff --git a/concurrent/futures/_base.py b/concurrent/futures/_base.py
index 1d90211..aaefa2b 100644
--- a/concurrent/futures/_base.py
+++ b/concurrent/futures/_base.py
@@ -122,8 +122,7 @@ class _AllCompletedWaiter(_Waiter):
super(_AllCompletedWaiter, self).__init__()
def _decrement_pending_calls(self):
- self.num_pending_calls -= 1
- if not self.num_pending_calls:
+ if self.num_pending_calls == len(self.finished_futures):
self.event.set()
def add_result(self, future):
diff --git a/docs/conf.py b/docs/conf.py
index 0c69562..124cd51 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -45,9 +45,9 @@ copyright = u'2009-2011, Brian Quinlan'
# built documents.
#
# The short X.Y version.
-version = '2.1.2'
+version = '2.1.3'
# The full version, including alpha/beta/rc tags.
-release = '2.1.2'
+release = '2.1.3'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
diff --git a/setup.py b/setup.py
index 9f973c6..f0dcd89 100755
--- a/setup.py
+++ b/setup.py
@@ -11,7 +11,7 @@ except ImportError:
from distutils.core import setup
setup(name='futures',
- version='2.1.2',
+ version='2.1.3',
description='Backport of the concurrent.futures package from Python 3.2',
author='Brian Quinlan',
author_email='brian@sweetapp.com',