Commit fdadfe0c authored by Xavier Thompson's avatar Xavier Thompson

Rename atomic reference counter as nogil_ob_refcnt

parent f952d0b3
...@@ -58,11 +58,11 @@ ...@@ -58,11 +58,11 @@
class CyObject : public PyObject { class CyObject : public PyObject {
private: private:
CyObject_ATOMIC_REFCOUNT_TYPE ob_refcnt; CyObject_ATOMIC_REFCOUNT_TYPE nogil_ob_refcnt;
//pthread_rwlock_t ob_lock; //pthread_rwlock_t ob_lock;
RecursiveUpgradeableRWLock ob_lock; RecursiveUpgradeableRWLock ob_lock;
public: public:
CyObject(): ob_refcnt(1) {} CyObject(): nogil_ob_refcnt(1) {}
virtual ~CyObject() {} virtual ~CyObject() {}
void CyObject_INCREF(); void CyObject_INCREF();
int CyObject_DECREF(); int CyObject_DECREF();
...@@ -383,12 +383,12 @@ int RecursiveUpgradeableRWLock::trywlock() { ...@@ -383,12 +383,12 @@ int RecursiveUpgradeableRWLock::trywlock() {
void CyObject::CyObject_INCREF() void CyObject::CyObject_INCREF()
{ {
atomic_fetch_add(&(this->ob_refcnt), 1); atomic_fetch_add(&(this->nogil_ob_refcnt), 1);
} }
int CyObject::CyObject_DECREF() 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; delete this;
return 1; return 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment