mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Add reference counting to AsyncObject
This commit is contained in:
committed by
Vinnie Falco
parent
d11983ae32
commit
370d98a858
@@ -64,6 +64,17 @@ public:
|
|||||||
Derived* m_owner;
|
Derived* m_owner;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void addReference ()
|
||||||
|
{
|
||||||
|
++m_pending;
|
||||||
|
}
|
||||||
|
|
||||||
|
void removeReference ()
|
||||||
|
{
|
||||||
|
if (--m_pending)
|
||||||
|
(static_cast <Derived *> (this))->asyncHandlersComplete ();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// The number of handlers pending.
|
// The number of handlers pending.
|
||||||
Atomic <int> m_pending;
|
Atomic <int> m_pending;
|
||||||
|
|||||||
Reference in New Issue
Block a user