mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-13 18:45:10 +01:00
trunk/branch integration: RefCountedObject to AtomicCounter
This commit is contained in:
parent
f252f79920
commit
abeb31a9c8
@ -40,7 +40,7 @@
|
||||
namespace Poco {
|
||||
|
||||
|
||||
RefCountedObject::RefCountedObject(): _rc(1)
|
||||
RefCountedObject::RefCountedObject(): _counter(1)
|
||||
{
|
||||
}
|
||||
|
||||
@ -50,21 +50,4 @@ RefCountedObject::~RefCountedObject()
|
||||
}
|
||||
|
||||
|
||||
void RefCountedObject::duplicate() const
|
||||
{
|
||||
_rcMutex.lock();
|
||||
++_rc;
|
||||
_rcMutex.unlock();
|
||||
}
|
||||
|
||||
|
||||
void RefCountedObject::release() const
|
||||
{
|
||||
_rcMutex.lock();
|
||||
int rc = --_rc;
|
||||
_rcMutex.unlock();
|
||||
if (rc == 0) delete this;
|
||||
}
|
||||
|
||||
|
||||
} // namespace Poco
|
||||
|
Loading…
Reference in New Issue
Block a user