Author: Armin Rigo <[email protected]>
Branch:
Changeset: r71730:01d8c6a4682b
Date: 2014-05-25 21:50 +0200
http://bitbucket.org/pypy/pypy/changeset/01d8c6a4682b/
Log: Add comments saying that PyGILState_Ensure() is pretty bogus.
diff --git a/pypy/module/cpyext/pystate.py b/pypy/module/cpyext/pystate.py
--- a/pypy/module/cpyext/pystate.py
+++ b/pypy/module/cpyext/pystate.py
@@ -208,6 +208,9 @@
@cpython_api([], PyGILState_STATE, error=CANNOT_FAIL)
def PyGILState_Ensure(space):
+ # XXX XXX XXX THIS IS A VERY MINIMAL IMPLEMENTATION THAT WILL HAPPILY
+ # DEADLOCK IF CALLED TWICE ON THE SAME THREAD, OR CRASH IF CALLED IN A
+ # NEW THREAD. We should very carefully follow what CPython does instead.
if rffi.aroundstate.after:
# After external call is before entering Python
rffi.aroundstate.after()
@@ -215,6 +218,7 @@
@cpython_api([PyGILState_STATE], lltype.Void)
def PyGILState_Release(space, state):
+ # XXX XXX XXX We should very carefully follow what CPython does instead.
if rffi.aroundstate.before:
# Before external call is after running Python
rffi.aroundstate.before()
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit