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
84ea02c8
Commit
84ea02c8
authored
Nov 09, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Take cypclass locking mode into account for automatic lock acquisition
parent
510e786b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
Cython/Compiler/CypclassTransforms.py
Cython/Compiler/CypclassTransforms.py
+9
-3
No files found.
Cython/Compiler/CypclassTransforms.py
View file @
84ea02c8
...
...
@@ -445,9 +445,15 @@ class CypclassLockTransform(Visitor.EnvTransform):
error
(
lock
.
pos
,
"A writelock is required, but a readlock is manually acquired"
)
return
obj
except
:
self
.
autolocks
+=
1
self
.
autowlocks
+=
exclusive
return
ExprNodes
.
CoerceToLockedNode
(
obj
,
self
.
current_env
(),
rlock_only
=
not
exclusive
)
lock_mode
=
obj
.
type
.
lock_mode
if
lock_mode
==
"autolock"
:
self
.
autolocks
+=
1
self
.
autowlocks
+=
exclusive
return
ExprNodes
.
CoerceToLockedNode
(
obj
,
self
.
current_env
(),
rlock_only
=
not
exclusive
)
elif
lock_mode
==
"checklock"
:
msg
=
"Reference '%s' is not correctly locked in this expression (%s lock required)"
error
(
obj
.
pos
,
msg
%
(
obj
.
name
,
"write"
if
exclusive
else
"read"
))
return
obj
def
__call__
(
self
,
root
):
self
.
locked
=
{}
...
...
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