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
563cb984
Commit
563cb984
authored
Jun 01, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix cypclass arguments of def methods being unlocked when already unlocked
parent
ff2db658
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
2 deletions
+14
-2
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+1
-1
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+9
-1
Cython/Utility/CyObjects.cpp
Cython/Utility/CyObjects.cpp
+4
-0
No files found.
Cython/Compiler/Nodes.py
View file @
563cb984
...
@@ -3406,7 +3406,7 @@ class DefNode(FuncDefNode):
...
@@ -3406,7 +3406,7 @@ class DefNode(FuncDefNode):
if
not
arg
.
name
:
if
not
arg
.
name
:
error
(
arg
.
pos
,
"Missing argument name"
)
error
(
arg
.
pos
,
"Missing argument name"
)
if
arg
.
needs_conversion
:
if
arg
.
needs_conversion
:
arg
.
entry
=
env
.
declare_var
(
arg
.
name
,
arg
.
type
,
arg
.
pos
)
arg
.
entry
=
env
.
declare_var
(
arg
.
name
,
arg
.
type
,
arg
.
pos
,
is_converted_arg
=
1
)
if
arg
.
type
.
is_pyobject
:
if
arg
.
type
.
is_pyobject
:
arg
.
entry
.
init
=
"0"
arg
.
entry
.
init
=
"0"
else
:
else
:
...
...
Cython/Compiler/Symtab.py
View file @
563cb984
...
@@ -2052,7 +2052,8 @@ class LocalScope(Scope):
...
@@ -2052,7 +2052,8 @@ class LocalScope(Scope):
def
declare_var
(
self
,
name
,
type
,
pos
,
def
declare_var
(
self
,
name
,
type
,
pos
,
cname
=
None
,
visibility
=
'private'
,
cname
=
None
,
visibility
=
'private'
,
api
=
0
,
in_pxd
=
0
,
is_cdef
=
0
):
api
=
0
,
in_pxd
=
0
,
is_cdef
=
0
,
is_converted_arg
=
0
):
name
=
self
.
mangle_class_private_name
(
name
)
name
=
self
.
mangle_class_private_name
(
name
)
# Add an entry for a local variable.
# Add an entry for a local variable.
if
visibility
in
(
'public'
,
'readonly'
):
if
visibility
in
(
'public'
,
'readonly'
):
...
@@ -2066,6 +2067,13 @@ class LocalScope(Scope):
...
@@ -2066,6 +2067,13 @@ class LocalScope(Scope):
entry
.
in_with_gil_block
=
self
.
_in_with_gil_block
entry
.
in_with_gil_block
=
self
.
_in_with_gil_block
self
.
var_entries
.
append
(
entry
)
self
.
var_entries
.
append
(
entry
)
# arguments converted as variables should still be locked as arguments
if
is_converted_arg
and
type
.
is_cyp_class
and
type
.
lock_mode
!=
"nolock"
:
arg_lock_state
=
self
.
declare_tracked
(
entry
)
arg_lock_state
.
is_rlocked
=
type
.
is_const
arg_lock_state
.
is_wlocked
=
not
type
.
is_const
return
entry
return
entry
def
declare_global
(
self
,
name
,
pos
):
def
declare_global
(
self
,
name
,
pos
):
...
...
Cython/Utility/CyObjects.cpp
View file @
563cb984
...
@@ -367,6 +367,10 @@ void RecursiveUpgradeableRWLock::unlock() {
...
@@ -367,6 +367,10 @@ void RecursiveUpgradeableRWLock::unlock() {
else
if
(
has_write_lock
)
{
else
if
(
has_write_lock
)
{
--
my_counts
.
write_count
;
--
my_counts
.
write_count
;
}
}
else
{
fprintf
(
stderr
,
"ERROR: trying to unlock already unlocked CyObject !
\n
"
);
return
;
}
if
(
!
my_counts
.
write_count
&&
!
my_counts
.
read_count
)
{
if
(
!
my_counts
.
write_count
&&
!
my_counts
.
read_count
)
{
pthread_rwlock_unlock
(
&
this
->
rw_lock
);
pthread_rwlock_unlock
(
&
this
->
rw_lock
);
my_counts
.
thread_id
=
0
;
my_counts
.
thread_id
=
0
;
...
...
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