Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r1200:37d1044bd114
Date: 2013-03-27 20:54 +0100
http://bitbucket.org/cffi/cffi/changeset/37d1044bd114/

Log:    Fix for a potential race condition in multithreaded programs (hard
        to test).

diff --git a/cffi/api.py b/cffi/api.py
--- a/cffi/api.py
+++ b/cffi/api.py
@@ -388,9 +388,9 @@
                     if enumname not in library.__dict__:
                         library.__dict__[enumname] = enumval
             copied_enums.append(True)
-            if name in library.__dict__:
-                return
         #
+        if name in library.__dict__:   # copied from an enum value just above,
+            return                     # or multithread's race condition
         raise AttributeError(name)
     #
     class FFILibrary(object):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to