summaryrefslogtreecommitdiff
path: root/cppuhelper/source/weak.cxx
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2012-09-16 02:00:14 -0500
committerNorbert Thiebaud <nthiebaud@gmail.com>2012-09-17 14:26:12 +0000
commit195f17ee40003f0ff74d08fecf5d68afe9cb1036 (patch)
treebeca88d96ae704d4ecb03defd9390b1a05a24c47 /cppuhelper/source/weak.cxx
parentc9d3373dadc1fbb36a6cf62661f0ec59b313d74b (diff)
migrate some of the biggest consumer of osl_*InterlockedCount to osl_atomic
Change-Id: I0e6992afbeffaf3b993e6630fb396d93012890e0 Reviewed-on: https://gerrit.libreoffice.org/632 Tested-by: Norbert Thiebaud <nthiebaud@gmail.com> Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'cppuhelper/source/weak.cxx')
-rw-r--r--cppuhelper/source/weak.cxx22
1 files changed, 11 insertions, 11 deletions
diff --git a/cppuhelper/source/weak.cxx b/cppuhelper/source/weak.cxx
index b40cb444388d..266811f365a5 100644
--- a/cppuhelper/source/weak.cxx
+++ b/cppuhelper/source/weak.cxx
@@ -100,13 +100,13 @@ Any SAL_CALL OWeakConnectionPoint::queryInterface( const Type & rType )
// XInterface
void SAL_CALL OWeakConnectionPoint::acquire() throw()
{
- osl_incrementInterlockedCount( &m_aRefCount );
+ osl_atomic_increment( &m_aRefCount );
}
// XInterface
void SAL_CALL OWeakConnectionPoint::release() throw()
{
- if (! osl_decrementInterlockedCount( &m_aRefCount ))
+ if (! osl_atomic_decrement( &m_aRefCount ))
delete this;
}
@@ -141,7 +141,7 @@ Reference< XInterface > SAL_CALL OWeakConnectionPoint::queryAdapted() throw(::co
if (m_pObject)
{
- oslInterlockedCount n = osl_incrementInterlockedCount( &m_pObject->m_refCount );
+ oslInterlockedCount n = osl_atomic_increment( &m_pObject->m_refCount );
if (n > 1)
{
@@ -150,11 +150,11 @@ Reference< XInterface > SAL_CALL OWeakConnectionPoint::queryAdapted() throw(::co
guard.clear();
// WeakObject has a (XInterface *) cast operator
ret = *m_pObject;
- n = osl_decrementInterlockedCount( &m_pObject->m_refCount );
+ n = osl_atomic_decrement( &m_pObject->m_refCount );
}
else
// Another thread wait in the dispose method at the guard
- n = osl_decrementInterlockedCount( &m_pObject->m_refCount );
+ n = osl_atomic_decrement( &m_pObject->m_refCount );
}
return ret;
@@ -199,13 +199,13 @@ Any SAL_CALL OWeakObject::queryInterface( const Type & rType ) throw(::com::sun:
// XInterface
void SAL_CALL OWeakObject::acquire() throw()
{
- osl_incrementInterlockedCount( &m_refCount );
+ osl_atomic_increment( &m_refCount );
}
// XInterface
void SAL_CALL OWeakObject::release() throw()
{
- if (osl_decrementInterlockedCount( &m_refCount ) == 0) {
+ if (osl_atomic_decrement( &m_refCount ) == 0) {
// notify/clear all weak-refs before object's dtor is executed
// (which may check weak-refs to this object):
disposeWeakConnectionPoint();
@@ -363,7 +363,7 @@ OWeakRefListener::OWeakRefListener(const OWeakRefListener& rRef) SAL_THROW(())
}
}
catch (RuntimeException &) { OSL_ASSERT( 0 ); } // assert here, but no unexpected()
- osl_decrementInterlockedCount( &m_aRefCount );
+ osl_atomic_decrement( &m_aRefCount );
}
OWeakRefListener::OWeakRefListener(const Reference< XInterface >& xInt) SAL_THROW(())
@@ -384,7 +384,7 @@ OWeakRefListener::OWeakRefListener(const Reference< XInterface >& xInt) SAL_THRO
}
}
catch (RuntimeException &) { OSL_ASSERT( 0 ); } // assert here, but no unexpected()
- osl_decrementInterlockedCount( &m_aRefCount );
+ osl_atomic_decrement( &m_aRefCount );
}
OWeakRefListener::~OWeakRefListener() SAL_THROW(())
@@ -410,13 +410,13 @@ Any SAL_CALL OWeakRefListener::queryInterface( const Type & rType ) throw(Runtim
// XInterface
void SAL_CALL OWeakRefListener::acquire() throw()
{
- osl_incrementInterlockedCount( &m_aRefCount );
+ osl_atomic_increment( &m_aRefCount );
}
// XInterface
void SAL_CALL OWeakRefListener::release() throw()
{
- if( ! osl_decrementInterlockedCount( &m_aRefCount ) )
+ if( ! osl_atomic_decrement( &m_aRefCount ) )
delete this;
}