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
Gwenaël Samain
cython
Commits
2e3b4b60
Commit
2e3b4b60
authored
Jul 03, 2019
by
gsamain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce some lock getters
parent
fc3506fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
2 deletions
+26
-2
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+26
-2
No files found.
Cython/Compiler/ExprNodes.py
View file @
2e3b4b60
...
...
@@ -703,6 +703,19 @@ class ExprNode(Node):
self
.
tracked_state
.
is_wlocked
=
True
self
.
tracked_state
.
needs_wlock
=
True
def
needs_rlock
(
self
):
if
self
.
tracked_state
is
None
:
return
False
return
self
.
tracked_state
.
needs_rlock
def
needs_wlock
(
self
):
if
self
.
tracked_state
is
None
:
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"
...
...
@@ -6034,6 +6047,12 @@ class SimpleCallNode(CallNode):
def
set_autowlock
(
self
,
env
):
self
.
wlocked
=
True
def
needs_rlock
(
self
):
return
self
.
rlocked
def
needs_wlock
(
self
):
return
self
.
wlocked
def
calculate_result_code
(
self
):
return
self
.
c_call_code
()
...
...
@@ -7512,9 +7531,9 @@ class AttributeNode(ExprNode):
rhs
.
result_as
(
self
.
ctype
())))
#rhs.result()))
if
self
.
is_autolock
():
if
tracked_state
.
needs_wlock
:
if
self
.
needs_wlock
()
:
code
.
putln
(
"Cy_WLOCK(%s);"
%
select_code
)
elif
tracked_state
.
needs_rlock
:
elif
self
.
needs_rlock
()
:
code
.
putln
(
"Cy_RLOCK(%s);"
%
select_code
)
rhs
.
generate_post_assignment_code
(
code
)
...
...
@@ -13723,11 +13742,16 @@ 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
def
ensure_lhs_locked
(
self
,
env
,
is_dereferenced
=
False
):
self
.
arg
.
ensure_lhs_locked
(
env
,
is_dereferenced
)
self
.
tracked_state
=
self
.
arg
.
tracked_state
def
coerce_to_boolean
(
self
,
env
):
self
.
arg
=
self
.
arg
.
coerce_to_boolean
(
env
)
...
...
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