Author: Remi Meier <remi.me...@inf.ethz.ch>
Branch: 
Changeset: r269:5ccc3f08f3bd
Date: 2014-07-22 14:00 +0200
http://bitbucket.org/pypy/benchmarks/changeset/5ccc3f08f3bd/

Log:    minor optimisation

diff --git a/multithread/common/abstract_threading.py 
b/multithread/common/abstract_threading.py
--- a/multithread/common/abstract_threading.py
+++ b/multithread/common/abstract_threading.py
@@ -156,9 +156,10 @@
 
 
     def __call__(self):
-        with self._cond:
-            while not self._done:
-                self._cond.wait()
+        if not self._done:
+            with self._cond:
+                while not self._done:
+                    self._cond.wait()
 
         if self._exception:
             raise self._exception
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to