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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
d3d65ce8
Commit
d3d65ce8
authored
5 years ago
by
gsamain
Committed by
Xavier Thompson
4 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clearer tracked state management (was_locked removal)
parent
caf5f764
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
16 deletions
+2
-16
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+0
-11
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+2
-2
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+0
-3
No files found.
Cython/Compiler/ExprNodes.py
View file @
d3d65ce8
...
...
@@ -319,7 +319,6 @@ class ExprNode(Node):
result_is_used
=
True
is_numpy_attribute
=
False
tracked_state
=
None
was_locked
=
False
# The Analyse Expressions phase for expressions is split
# into two sub-phases:
...
...
@@ -724,12 +723,10 @@ class ExprNode(Node):
error
(
self
.
pos
,
"Address is not constant"
)
def
set_autorlock
(
self
,
env
):
self
.
tracked_state
.
was_locked
=
True
self
.
tracked_state
.
is_rlocked
=
True
self
.
tracked_state
.
needs_rlock
=
True
def
set_autowlock
(
self
,
env
):
self
.
tracked_state
.
was_locked
=
True
self
.
tracked_state
.
is_wlocked
=
True
self
.
tracked_state
.
needs_wlock
=
True
...
...
@@ -743,9 +740,6 @@ class ExprNode(Node):
return
False
return
self
.
tracked_state
.
needs_wlock
def
get_was_locked
(
self
):
return
self
.
was_locked
def
is_autolock
(
self
):
return
self
.
type
.
is_cyp_class
and
self
.
type
.
lock_mode
==
"autolock"
...
...
@@ -760,8 +754,6 @@ class ExprNode(Node):
self
.
tracked_state
=
env
.
declare_tracked
(
self
.
entry
)
if
self
.
is_autolock
()
and
self
.
entry
.
is_variable
:
env
.
declare_autolocked
(
self
)
self
.
was_locked
=
self
.
tracked_state
.
was_locked
self
.
tracked_state
.
was_locked
=
True
def
is_rhs_locked
(
self
,
env
):
if
not
hasattr
(
self
,
'entry'
)
or
not
self
.
entry
.
type
.
is_cyp_class
:
...
...
@@ -13852,9 +13844,6 @@ class CoerceToTempNode(CoercionNode):
# The arg is always already analysed
return
self
def
get_was_locked
(
self
):
return
self
.
arg
.
get_was_locked
()
def
ensure_rhs_locked
(
self
,
env
,
is_dereferenced
=
False
):
self
.
arg
.
ensure_rhs_locked
(
env
,
is_dereferenced
)
self
.
tracked_state
=
self
.
arg
.
tracked_state
...
...
This diff is collapsed.
Click to expand it.
Cython/Compiler/Nodes.py
View file @
d3d65ce8
...
...
@@ -2046,7 +2046,7 @@ class FuncDefNode(StatNode, BlockNode):
code
.
funcstate
.
gil_owned
=
False
for
node
in
lenv
.
autolocked_nodes
:
if
node
.
entry
.
is_variable
and
not
node
.
entry
.
is_local
and
(
node
.
tracked_state
.
needs_wlock
or
node
.
tracked_state
.
needs_rlock
):
if
node
.
entry
.
is_variable
and
not
node
.
entry
.
is_local
and
(
node
.
needs_wlock
()
or
node
.
needs_rlock
()
):
node_result
=
node
.
result
()
code
.
putln
(
"if (%s != NULL)"
%
node_result
)
if
node
.
needs_wlock
():
...
...
@@ -2223,7 +2223,7 @@ class FuncDefNode(StatNode, BlockNode):
# which leads to a dangling lock on the previous reference
# (and attempt to unlock a non-locked ref).
if
no
t
node
.
get_was_locked
()
and
(
node
.
tracked_state
.
needs_wlock
or
node
.
tracked_state
.
needs_rlock
):
if
no
de
.
needs_wlock
()
or
node
.
needs_rlock
(
):
code
.
putln
(
"Cy_UNLOCK(%s);"
%
node
.
result
())
for
entry
in
lenv
.
var_entries
:
...
...
This diff is collapsed.
Click to expand it.
Cython/Compiler/Symtab.py
View file @
d3d65ce8
...
...
@@ -162,7 +162,6 @@ class Entry(object):
# is_rlocked boolean Is locked with a read lock (used for cypclass)
# needs_rlock boolean The entry needs a read lock (used in autolock mode)
# needs_wlock boolean The entry needs a write lock (used in autolock mode)
# was_locked boolean Indicates to nodes falling through that the first lock already took place
# TODO: utility_code and utility_code_definition serves the same purpose...
...
...
@@ -238,7 +237,6 @@ class Entry(object):
is_rlocked
=
False
needs_rlock
=
False
needs_wlock
=
False
was_locked
=
False
def
__init__
(
self
,
name
,
cname
,
type
,
pos
=
None
,
init
=
None
):
self
.
name
=
name
...
...
@@ -321,7 +319,6 @@ class TrackedLockedEntry:
self
.
is_rlocked
=
False
self
.
needs_wlock
=
False
self
.
needs_rlock
=
False
self
.
was_locked
=
False
class
Scope
(
object
):
# name string Unqualified name
...
...
This diff is collapsed.
Click to expand it.
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