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
Xavier Thompson
cython
Commits
108d4195
Commit
108d4195
authored
Jul 03, 2019
by
gsamain
Committed by
Xavier Thompson
Jun 18, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce some lock getters
parent
251d92e4
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 @
108d4195
...
...
@@ -733,6 +733,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"
...
...
@@ -6128,6 +6141,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
()
...
...
@@ -7612,9 +7631,9 @@ class AttributeNode(ExprNode):
rhs
.
move_result_rhs_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
)
...
...
@@ -13845,11 +13864,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