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 /framework | |
parent | bcd2b017088822ea95e9d33d1d0dc360c0ec8d74 (diff) |
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 'framework')
-rw-r--r-- | framework/inc/helper/shareablemutex.hxx | 4 | ||||
-rw-r--r-- | framework/source/fwe/helper/documentundoguard.cxx | 14 | ||||
-rw-r--r-- | framework/source/uiconfiguration/imagemanagerimpl.cxx | 4 |
3 files changed, 11 insertions, 11 deletions
diff --git a/framework/inc/helper/shareablemutex.hxx b/framework/inc/helper/shareablemutex.hxx index c96af1a5926a..a99a44e553f7 100644 --- a/framework/inc/helper/shareablemutex.hxx +++ b/framework/inc/helper/shareablemutex.hxx @@ -54,12 +54,12 @@ class FWI_DLLPUBLIC ShareableMutex MutexRef() : m_refCount(0) {} void acquire() { - osl_incrementInterlockedCount( &m_refCount ); + osl_atomic_increment( &m_refCount ); } void release() { - if ( osl_decrementInterlockedCount( &m_refCount ) == 0 ) + if ( osl_atomic_decrement( &m_refCount ) == 0 ) delete this; } diff --git a/framework/source/fwe/helper/documentundoguard.cxx b/framework/source/fwe/helper/documentundoguard.cxx index fb522f905a2c..8fe601152797 100644 --- a/framework/source/fwe/helper/documentundoguard.cxx +++ b/framework/source/fwe/helper/documentundoguard.cxx @@ -62,11 +62,11 @@ namespace framework ,m_nRelativeContextDepth( 0 ) ,m_documentDisposed( false ) { - osl_incrementInterlockedCount( &m_refCount ); + osl_atomic_increment( &m_refCount ); { m_xUndoManager->addUndoManagerListener( this ); } - osl_decrementInterlockedCount( &m_refCount ); + osl_atomic_decrement( &m_refCount ); } UndoManagerContextListener() @@ -158,35 +158,35 @@ namespace framework void SAL_CALL UndoManagerContextListener::enteredContext( const UndoManagerEvent& i_event ) throw (RuntimeException) { (void)i_event; - osl_incrementInterlockedCount( &m_nRelativeContextDepth ); + osl_atomic_increment( &m_nRelativeContextDepth ); } //------------------------------------------------------------------------------------------------------------------ void SAL_CALL UndoManagerContextListener::enteredHiddenContext( const UndoManagerEvent& i_event ) throw (RuntimeException) { (void)i_event; - osl_incrementInterlockedCount( &m_nRelativeContextDepth ); + osl_atomic_increment( &m_nRelativeContextDepth ); } //------------------------------------------------------------------------------------------------------------------ void SAL_CALL UndoManagerContextListener::leftContext( const UndoManagerEvent& i_event ) throw (RuntimeException) { (void)i_event; - osl_decrementInterlockedCount( &m_nRelativeContextDepth ); + osl_atomic_decrement( &m_nRelativeContextDepth ); } //------------------------------------------------------------------------------------------------------------------ void SAL_CALL UndoManagerContextListener::leftHiddenContext( const UndoManagerEvent& i_event ) throw (RuntimeException) { (void)i_event; - osl_decrementInterlockedCount( &m_nRelativeContextDepth ); + osl_atomic_decrement( &m_nRelativeContextDepth ); } //------------------------------------------------------------------------------------------------------------------ void SAL_CALL UndoManagerContextListener::cancelledContext( const UndoManagerEvent& i_event ) throw (RuntimeException) { (void)i_event; - osl_decrementInterlockedCount( &m_nRelativeContextDepth ); + osl_atomic_decrement( &m_nRelativeContextDepth ); } //------------------------------------------------------------------------------------------------------------------ diff --git a/framework/source/uiconfiguration/imagemanagerimpl.cxx b/framework/source/uiconfiguration/imagemanagerimpl.cxx index ea4dd1191f4b..54fdc51d5093 100644 --- a/framework/source/uiconfiguration/imagemanagerimpl.cxx +++ b/framework/source/uiconfiguration/imagemanagerimpl.cxx @@ -371,7 +371,7 @@ bool GlobalImageList::hasImage( sal_Int16 nImageType, const rtl::OUString& rComm oslInterlockedCount GlobalImageList::acquire() { - osl_incrementInterlockedCount( &m_nRefCount ); + osl_atomic_increment( &m_nRefCount ); return m_nRefCount; } @@ -379,7 +379,7 @@ oslInterlockedCount GlobalImageList::release() { osl::MutexGuard guard( getGlobalImageListMutex() ); - if ( !osl_decrementInterlockedCount( &m_nRefCount )) + if ( !osl_atomic_decrement( &m_nRefCount )) { oslInterlockedCount nCount( m_nRefCount ); // remove global pointer as we destroy the object now |