diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-09-22 01:51:12 -0500 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2012-09-25 01:55:38 +0000 |
commit | 750fc206113a796035cbc05fb904fbae0eb771a8 (patch) | |
tree | 4ea1f0378c2b6d7f50480d3b9051de91780219cd /comphelper | |
parent | Build fix. (diff) | |
download | core-750fc206113a796035cbc05fb904fbae0eb771a8.tar.gz core-750fc206113a796035cbc05fb904fbae0eb771a8.zip |
replace remaining InterlockedCount() with inlined version
Change-Id: Ifcfa48fc87f905a91470a5b0fd597b02f220784c
Reviewed-on: https://gerrit.libreoffice.org/671
Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com>
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/inc/comphelper/uno3.hxx | 4 | ||||
-rw-r--r-- | comphelper/source/misc/SelectionMultiplex.cxx | 4 | ||||
-rw-r--r-- | comphelper/source/misc/accessiblewrapper.cxx | 4 | ||||
-rw-r--r-- | comphelper/source/misc/asyncnotification.cxx | 4 | ||||
-rw-r--r-- | comphelper/source/misc/componentmodule.cxx | 4 | ||||
-rw-r--r-- | comphelper/source/misc/proxyaggregation.cxx | 8 | ||||
-rw-r--r-- | comphelper/source/misc/weakeventlistener.cxx | 4 |
7 files changed, 16 insertions, 16 deletions
diff --git a/comphelper/inc/comphelper/uno3.hxx b/comphelper/inc/comphelper/uno3.hxx index 935221c45b6f..1b83c73f4f25 100644 --- a/comphelper/inc/comphelper/uno3.hxx +++ b/comphelper/inc/comphelper/uno3.hxx @@ -35,8 +35,8 @@ namespace comphelper //========================================================================= /// manipulate ref counts without calling acquire/release - inline oslInterlockedCount increment(oslInterlockedCount& _counter) { return osl_incrementInterlockedCount(&_counter); } - inline oslInterlockedCount decrement(oslInterlockedCount& _counter) { return osl_decrementInterlockedCount(&_counter); } + inline oslInterlockedCount increment(oslInterlockedCount& _counter) { return osl_atomic_increment(&_counter); } + inline oslInterlockedCount decrement(oslInterlockedCount& _counter) { return osl_atomic_decrement(&_counter); } //========================================================================= diff --git a/comphelper/source/misc/SelectionMultiplex.cxx b/comphelper/source/misc/SelectionMultiplex.cxx index aa3092d1886d..d4cca73a7da0 100644 --- a/comphelper/source/misc/SelectionMultiplex.cxx +++ b/comphelper/source/misc/SelectionMultiplex.cxx @@ -76,12 +76,12 @@ OSelectionChangeMultiplexer::OSelectionChangeMultiplexer(OSelectionChangeListene ,m_bAutoSetRelease(_bAutoReleaseSet) { m_pListener->setAdapter(this); - osl_incrementInterlockedCount(&m_refCount); + osl_atomic_increment(&m_refCount); { Reference< XSelectionChangeListener> xPreventDelete(this); m_xSet->addSelectionChangeListener(xPreventDelete); } - osl_decrementInterlockedCount(&m_refCount); + osl_atomic_decrement(&m_refCount); } //------------------------------------------------------------------ diff --git a/comphelper/source/misc/accessiblewrapper.cxx b/comphelper/source/misc/accessiblewrapper.cxx index 26e85c6f6231..20276067a117 100644 --- a/comphelper/source/misc/accessiblewrapper.cxx +++ b/comphelper/source/misc/accessiblewrapper.cxx @@ -401,13 +401,13 @@ namespace comphelper componentAggregateProxyFor( xInnerComponent, _rRefCount, _rDelegator ); // add as event listener to the inner context, because we want to multiplex the AccessibleEvents - osl_incrementInterlockedCount( &_rRefCount ); + osl_atomic_increment( &_rRefCount ); { Reference< XAccessibleEventBroadcaster > xBroadcaster( m_xInner, UNO_QUERY ); if ( xBroadcaster.is() ) xBroadcaster->addEventListener( this ); } - osl_decrementInterlockedCount( &_rRefCount ); + osl_atomic_decrement( &_rRefCount ); } //-------------------------------------------------------------------- diff --git a/comphelper/source/misc/asyncnotification.cxx b/comphelper/source/misc/asyncnotification.cxx index 9b799d219cf1..308ba4a11e44 100644 --- a/comphelper/source/misc/asyncnotification.cxx +++ b/comphelper/source/misc/asyncnotification.cxx @@ -50,13 +50,13 @@ namespace comphelper //-------------------------------------------------------------------- oslInterlockedCount SAL_CALL AnyEvent::acquire() { - return osl_incrementInterlockedCount( &m_refCount ); + return osl_atomic_increment( &m_refCount ); } //-------------------------------------------------------------------- oslInterlockedCount SAL_CALL AnyEvent::release() { - if ( 0 == osl_decrementInterlockedCount( &m_refCount ) ) + if ( 0 == osl_atomic_decrement( &m_refCount ) ) { delete this; return 0; diff --git a/comphelper/source/misc/componentmodule.cxx b/comphelper/source/misc/componentmodule.cxx index 409714893885..8a4cc74f8ced 100644 --- a/comphelper/source/misc/componentmodule.cxx +++ b/comphelper/source/misc/componentmodule.cxx @@ -85,7 +85,7 @@ namespace comphelper void OModule::registerClient( OModule::ClientAccess ) { ::osl::MutexGuard aGuard(m_aMutex); - if ( 1 == osl_incrementInterlockedCount( &m_nClients ) ) + if ( 1 == osl_atomic_increment( &m_nClients ) ) onFirstClient(); } @@ -93,7 +93,7 @@ namespace comphelper void OModule::revokeClient( OModule::ClientAccess ) { ::osl::MutexGuard aGuard(m_aMutex); - if ( 0 == osl_decrementInterlockedCount( &m_nClients ) ) + if ( 0 == osl_atomic_decrement( &m_nClients ) ) onLastClient(); } diff --git a/comphelper/source/misc/proxyaggregation.cxx b/comphelper/source/misc/proxyaggregation.cxx index e98b21eb093b..6d190ff91b14 100644 --- a/comphelper/source/misc/proxyaggregation.cxx +++ b/comphelper/source/misc/proxyaggregation.cxx @@ -59,7 +59,7 @@ namespace comphelper m_xProxyAggregate->queryAggregation( ::getCppuType( &m_xProxyTypeAccess ) ) >>= m_xProxyTypeAccess; // aggregate the proxy - osl_incrementInterlockedCount( &_rRefCount ); + osl_atomic_increment( &_rRefCount ); if ( m_xProxyAggregate.is() ) { // At this point in time, the proxy has a ref count of exactly two - in m_xControlContextProxy, @@ -67,7 +67,7 @@ namespace comphelper // Remember to _not_ reset these members unless the delegator of the proxy has been reset, too! m_xProxyAggregate->setDelegator( _rDelegator ); } - osl_decrementInterlockedCount( &_rRefCount ); + osl_atomic_decrement( &_rRefCount ); } } @@ -124,12 +124,12 @@ namespace comphelper baseAggregateProxyFor( m_xInner.get(), _rRefCount, _rDelegator ); // add as event listener to the inner context, because we want to be notified of disposals - osl_incrementInterlockedCount( &_rRefCount ); + osl_atomic_increment( &_rRefCount ); { if ( m_xInner.is() ) m_xInner->addEventListener( this ); } - osl_decrementInterlockedCount( &_rRefCount ); + osl_atomic_decrement( &_rRefCount ); } //------------------------------------------------------------------------- diff --git a/comphelper/source/misc/weakeventlistener.cxx b/comphelper/source/misc/weakeventlistener.cxx index 288b15995f37..db176d4b643a 100644 --- a/comphelper/source/misc/weakeventlistener.cxx +++ b/comphelper/source/misc/weakeventlistener.cxx @@ -48,11 +48,11 @@ namespace comphelper OSL_ENSURE( _rxBroadcaster.is(), "OWeakEventListenerAdapter::OWeakEventListenerAdapter: invalid broadcaster!" ); if ( _rxBroadcaster.is() ) { - osl_incrementInterlockedCount( &m_refCount ); + osl_atomic_increment( &m_refCount ); { _rxBroadcaster->addEventListener( this ); } - osl_decrementInterlockedCount( &m_refCount ); + osl_atomic_decrement( &m_refCount ); OSL_ENSURE( m_refCount > 0, "OWeakEventListenerAdapter::OWeakEventListenerAdapter: oops - not to be used with implementations which hold their listeners weak!" ); // the one and only reason for this adapter class (A) is to add as listener to a component (C) which // holds its listeners hard, and forward all calls then to another listener (L) which is |