Author: Armin Rigo <[email protected]>
Branch:
Changeset: r81449:92260a86b33b
Date: 2015-12-28 12:25 +0100
http://bitbucket.org/pypy/pypy/changeset/92260a86b33b/
Log: Non-translated-only test fix (test_macro_var_callback): we must now
release/reacquire the gil from thread_gil.c in this mode too
diff --git a/pypy/module/_cffi_backend/cglob.py
b/pypy/module/_cffi_backend/cglob.py
--- a/pypy/module/_cffi_backend/cglob.py
+++ b/pypy/module/_cffi_backend/cglob.py
@@ -3,6 +3,7 @@
from pypy.interpreter.typedef import TypeDef
from pypy.module._cffi_backend.cdataobj import W_CData
from pypy.module._cffi_backend import newtype
+from rpython.rlib import rgil
from rpython.rlib.objectmodel import we_are_translated
from rpython.rtyper.lltypesystem import lltype, rffi
from rpython.translator.tool.cbuild import ExternalCompilationInfo
@@ -26,7 +27,9 @@
if not we_are_translated():
FNPTR = rffi.CCallback([], rffi.VOIDP)
fetch_addr = rffi.cast(FNPTR, self.fetch_addr)
+ rgil.release()
result = fetch_addr()
+ rgil.acquire()
else:
# careful in translated versions: we need to call fetch_addr,
# but in a GIL-releasing way. The easiest is to invoke a
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit