Commit 97fb24d7 authored by Stefan Behnel's avatar Stefan Behnel

minor cleanups

parent 0066fe43
......@@ -1075,7 +1075,7 @@ class FuncDefNode(StatNode, BlockNode):
# ----- GIL acquisition
acquire_gil = self.need_gil_acquisition(lenv)
if acquire_gil:
env.use_utility_code(py23_init_threads_utility_code)
env.use_utility_code(force_init_threads_utility_code)
code.putln("PyGILState_STATE _save = PyGILState_Ensure();")
# ----- Automatic lead-ins for certain special functions
if not lenv.nogil:
......@@ -4529,7 +4529,7 @@ class GILStatNode(TryFinallyStatNode):
finally_clause = GILExitNode(pos, state = state))
def analyse_expressions(self, env):
env.use_utility_code(py23_init_threads_utility_code)
env.use_utility_code(force_init_threads_utility_code)
was_nogil = env.nogil
env.nogil = 1
TryFinallyStatNode.analyse_expressions(self, env)
......@@ -4539,11 +4539,11 @@ class GILStatNode(TryFinallyStatNode):
pass
def generate_execution_code(self, code):
code.putln("/*with %s:*/ {" % self.state)
code.mark_pos(self.pos)
if self.state == 'gil':
code.putln("PyGILState_STATE _save = PyGILState_Ensure();")
code.putln("{ PyGILState_STATE _save = PyGILState_Ensure();")
else:
code.putln("PyThreadState *_save;")
code.putln("{ PyThreadState *_save;")
code.putln("Py_UNBLOCK_THREADS")
TryFinallyStatNode.generate_execution_code(self, code)
code.putln("}")
......@@ -5624,7 +5624,7 @@ static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb)
#------------------------------------------------------------------------------------
py23_init_threads_utility_code = UtilityCode(
force_init_threads_utility_code = UtilityCode(
proto="""
#ifndef __PYX_FORCE_INIT_THREADS
#if PY_VERSION_HEX < 0x02040200
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment