Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
97fb24d7
Commit
97fb24d7
authored
Mar 19, 2009
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor cleanups
parent
0066fe43
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+6
-6
No files found.
Cython/Compiler/Nodes.py
View file @
97fb24d7
...
...
@@ -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
...
...
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