Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
PyPy
pypy
Commits
01d8c6a4682b
Commit
df69644a
authored
May 25, 2014
by
Armin Rigo
Browse files
Add comments saying that PyGILState_Ensure() is pretty bogus.
parent
6d4973cec392
Changes
1
Hide whitespace changes
Inline
Side-by-side
pypy/module/cpyext/pystate.py
View file @
01d8c6a4
...
...
@@ -208,6 +208,9 @@ PyGILState_STATE = rffi.INT
@
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 @@ def PyGILState_Ensure(space):
@
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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment