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
8cb165b4
Commit
8cb165b4
authored
Jun 14, 2019
by
gsamain
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean lock management for reifying messages
parent
ace24117
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
Cython/Compiler/ModuleNode.py
Cython/Compiler/ModuleNode.py
+12
-0
No files found.
Cython/Compiler/ModuleNode.py
View file @
8cb165b4
...
@@ -1258,6 +1258,16 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -1258,6 +1258,16 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
if
opt_arg_count
:
if
opt_arg_count
:
reified_call_args_list
.
append
(
message_opt_arg_attr_name
)
reified_call_args_list
.
append
(
message_opt_arg_attr_name
)
# Locking CyObjects
# Here we completely ignore the lock mode (nolock/checklock/autolock)
# because the mode is used for direct calls, when the user have the possibility
# to manually lock or let the compiler handle it.
# Here, the user cannot lock manually, so we're taking the lock automatically.
put_cypclass_op_on_narg_optarg
(
lambda
arg
:
"Cy_RLOCK"
if
arg
.
type
.
is_const
else
"Cy_WLOCK"
,
reified_function_entry
.
type
,
message_opt_arg_attr_name
,
code
)
op
=
"Cy_RLOCK"
if
reified_function_entry
.
type
.
is_const_method
else
"Cy_WLOCK"
code
.
putln
(
"%s(this->%s);"
%
(
op
,
target_object_cname
))
does_return
=
reified_function_entry
.
type
.
return_type
is
not
PyrexTypes
.
c_void_type
does_return
=
reified_function_entry
.
type
.
return_type
is
not
PyrexTypes
.
c_void_type
if
does_return
:
if
does_return
:
result_assignment
=
"%s = "
%
reified_function_entry
.
type
.
return_type
.
declaration_code
(
"result"
)
result_assignment
=
"%s = "
%
reified_function_entry
.
type
.
return_type
.
declaration_code
(
"result"
)
...
@@ -1268,6 +1278,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
...
@@ -1268,6 +1278,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
", "
.
join
(
"this->%s"
%
arg_cname
for
arg_cname
in
reified_call_args_list
)
", "
.
join
(
"this->%s"
%
arg_cname
for
arg_cname
in
reified_call_args_list
)
)
)
)
)
code
.
putln
(
"Cy_UNLOCK(this->%s);"
%
target_object_cname
)
put_cypclass_op_on_narg_optarg
(
lambda
_
:
"Cy_UNLOCK"
,
reified_function_entry
.
type
,
message_opt_arg_attr_name
,
code
)
code
.
putln
(
"/* Push result in the result object */"
)
code
.
putln
(
"/* Push result in the result object */"
)
if
reified_function_entry
.
type
.
return_type
is
PyrexTypes
.
c_int_type
:
if
reified_function_entry
.
type
.
return_type
is
PyrexTypes
.
c_int_type
:
code
.
putln
(
"this->_result->pushIntResult(result);"
)
code
.
putln
(
"this->_result->pushIntResult(result);"
)
...
...
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