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
b264f865
Commit
b264f865
authored
May 20, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rename atomic reference counter as nogil_ob_refcnt
parent
d84c2927
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
Cython/Utility/CyObjects.cpp
Cython/Utility/CyObjects.cpp
+4
-4
No files found.
Cython/Utility/CyObjects.cpp
View file @
b264f865
...
...
@@ -58,11 +58,11 @@
class
CyObject
:
public
PyObject
{
private:
CyObject_ATOMIC_REFCOUNT_TYPE
ob_refcnt
;
CyObject_ATOMIC_REFCOUNT_TYPE
nogil_
ob_refcnt
;
//pthread_rwlock_t ob_lock;
RecursiveUpgradeableRWLock
ob_lock
;
public:
CyObject
()
:
ob_refcnt
(
1
)
{}
CyObject
()
:
nogil_
ob_refcnt
(
1
)
{}
virtual
~
CyObject
()
{}
void
CyObject_INCREF
();
int
CyObject_DECREF
();
...
...
@@ -383,12 +383,12 @@ int RecursiveUpgradeableRWLock::trywlock() {
void
CyObject
::
CyObject_INCREF
()
{
atomic_fetch_add
(
&
(
this
->
ob_refcnt
),
1
);
atomic_fetch_add
(
&
(
this
->
nogil_
ob_refcnt
),
1
);
}
int
CyObject
::
CyObject_DECREF
()
{
if
(
atomic_fetch_sub
(
&
(
this
->
ob_refcnt
),
1
)
==
1
)
{
if
(
atomic_fetch_sub
(
&
(
this
->
nogil_
ob_refcnt
),
1
)
==
1
)
{
delete
this
;
return
1
;
}
...
...
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