Rename increment/decrement ref count APIs
This commit is contained in:
parent
c628177b94
commit
65c859030d
@ -20,12 +20,12 @@ namespace rcp_internal
|
|||||||
virtual ~root() = default;
|
virtual ~root() = default;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void add_ref() const
|
void rcp_inc() const
|
||||||
{
|
{
|
||||||
ref_count.fetch_add(1, std::memory_order_relaxed);
|
ref_count.fetch_add(1, std::memory_order_relaxed);
|
||||||
}
|
}
|
||||||
|
|
||||||
void release_ref() const
|
void rcp_dec() const
|
||||||
{
|
{
|
||||||
if (ref_count.fetch_sub(1, std::memory_order_acq_rel) == 0)
|
if (ref_count.fetch_sub(1, std::memory_order_acq_rel) == 0)
|
||||||
{
|
{
|
||||||
@ -67,7 +67,7 @@ private:
|
|||||||
{
|
{
|
||||||
if (p)
|
if (p)
|
||||||
{
|
{
|
||||||
ptr->add_ref();
|
ptr->rcp_inc();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ public:
|
|||||||
{
|
{
|
||||||
if (ptr)
|
if (ptr)
|
||||||
{
|
{
|
||||||
ptr->add_ref();
|
ptr->rcp_inc();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ public:
|
|||||||
{
|
{
|
||||||
if (ptr)
|
if (ptr)
|
||||||
{
|
{
|
||||||
ptr->release_ref();
|
ptr->rcp_dec();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,7 +98,7 @@ public:
|
|||||||
{
|
{
|
||||||
if (ptr)
|
if (ptr)
|
||||||
{
|
{
|
||||||
ptr->add_ref();
|
ptr->rcp_inc();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user