diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-09-16 02:00:14 -0500 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-09-17 14:26:12 +0000 |
commit | 195f17ee40003f0ff74d08fecf5d68afe9cb1036 (patch) | |
tree | beca88d96ae704d4ecb03defd9390b1a05a24c47 /cppuhelper | |
parent | Help compilers with explicit template argument. (diff) | |
download | core-195f17ee40003f0ff74d08fecf5d68afe9cb1036.tar.gz core-195f17ee40003f0ff74d08fecf5d68afe9cb1036.zip |
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')
-rw-r--r-- | cppuhelper/source/component.cxx | 4 | ||||
-rw-r--r-- | cppuhelper/source/component_context.cxx | 6 | ||||
-rw-r--r-- | cppuhelper/source/implbase.cxx | 8 | ||||
-rw-r--r-- | cppuhelper/source/weak.cxx | 22 |
4 files changed, 20 insertions, 20 deletions
diff --git a/cppuhelper/source/component.cxx b/cppuhelper/source/component.cxx index 1cc7c2fdd79b..cc77a90ae008 100644 --- a/cppuhelper/source/component.cxx +++ b/cppuhelper/source/component.cxx @@ -85,7 +85,7 @@ void OComponentHelper::release() throw() Reference<XInterface > x( xDelegator ); if (! x.is()) { - if (osl_decrementInterlockedCount( &m_refCount ) == 0) + if (osl_atomic_decrement( &m_refCount ) == 0) { if (! rBHelper.bDisposed) { @@ -117,7 +117,7 @@ void OComponentHelper::release() throw() } } // restore the reference count - osl_incrementInterlockedCount( &m_refCount ); + osl_atomic_increment( &m_refCount ); } OWeakAggObject::release(); } diff --git a/cppuhelper/source/component_context.cxx b/cppuhelper/source/component_context.cxx index 6ca08be08580..a07cd0e8f302 100644 --- a/cppuhelper/source/component_context.cxx +++ b/cppuhelper/source/component_context.cxx @@ -796,7 +796,7 @@ ComponentContext::ComponentContext( Reference< lang::XMultiComponentFactory > xMgr( m_xDelegate->getServiceManager() ); if (xMgr.is()) { - osl_incrementInterlockedCount( &m_refCount ); + osl_atomic_increment( &m_refCount ); try { // create new smgr based on delegate's one @@ -815,10 +815,10 @@ ComponentContext::ComponentContext( } catch (...) { - osl_decrementInterlockedCount( &m_refCount ); + osl_atomic_decrement( &m_refCount ); throw; } - osl_decrementInterlockedCount( &m_refCount ); + osl_atomic_decrement( &m_refCount ); OSL_ASSERT( m_xSMgr.is() ); } } diff --git a/cppuhelper/source/implbase.cxx b/cppuhelper/source/implbase.cxx index fbe7ed69b79c..60e6facaca1b 100644 --- a/cppuhelper/source/implbase.cxx +++ b/cppuhelper/source/implbase.cxx @@ -238,11 +238,11 @@ void WeakComponentImplHelperBase::acquire() void WeakComponentImplHelperBase::release() throw () { - if (osl_decrementInterlockedCount( &m_refCount ) == 0) { + if (osl_atomic_decrement( &m_refCount ) == 0) { // ensure no other references are created, via the weak connection point, from now on disposeWeakConnectionPoint(); // restore reference count: - osl_incrementInterlockedCount( &m_refCount ); + osl_atomic_increment( &m_refCount ); if (! rBHelper.bDisposed) { try { dispose(); @@ -374,11 +374,11 @@ void WeakAggComponentImplHelperBase::release() if (xDelegator_.is()) { OWeakAggObject::release(); } - else if (osl_decrementInterlockedCount( &m_refCount ) == 0) { + else if (osl_atomic_decrement( &m_refCount ) == 0) { // ensure no other references are created, via the weak connection point, from now on disposeWeakConnectionPoint(); // restore reference count: - osl_incrementInterlockedCount( &m_refCount ); + osl_atomic_increment( &m_refCount ); if (! rBHelper.bDisposed) { try { dispose(); 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; } |