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>
This commit is contained in:
Norbert Thiebaud
2012-09-22 01:51:12 -05:00
parent bcd2b01708
commit 750fc20611
239 changed files with 529 additions and 532 deletions

View File

@@ -370,7 +370,7 @@ ODatabaseForm::ODatabaseForm( const ODatabaseForm& _cloneSource )
impl_construct();
osl_incrementInterlockedCount( &m_refCount );
osl_atomic_increment( &m_refCount );
{
// our aggregated rowset itself is not cloneable, so simply copy the properties
::comphelper::copyProperties( _cloneSource.m_xAggregateSet, m_xAggregateSet );
@@ -419,7 +419,7 @@ ODatabaseForm::ODatabaseForm( const ODatabaseForm& _cloneSource )
);
}
}
osl_decrementInterlockedCount( &m_refCount );
osl_atomic_decrement( &m_refCount );
}
//------------------------------------------------------------------
@@ -1480,9 +1480,9 @@ void SAL_CALL ODatabaseForm::clearWarnings( ) throw (SQLException, RuntimeExcep
Reference< XCloneable > SAL_CALL ODatabaseForm::createClone( ) throw (RuntimeException)
{
ODatabaseForm* pClone = new ODatabaseForm( *this );
osl_incrementInterlockedCount( &pClone->m_refCount );
osl_atomic_increment( &pClone->m_refCount );
pClone->clonedFrom( *this );
osl_decrementInterlockedCount( &pClone->m_refCount );
osl_atomic_decrement( &pClone->m_refCount );
return pClone;
}

View File

@@ -109,7 +109,7 @@ ODateModel::ODateModel(const Reference<XMultiServiceFactory>& _rxFactory)
setAggregateSet(m_xAggregateFastSet, getOriginalHandle(PROPERTY_ID_DATEFORMAT));
osl_incrementInterlockedCount( &m_refCount );
osl_atomic_increment( &m_refCount );
try
{
if ( m_xAggregateSet.is() )
@@ -119,7 +119,7 @@ ODateModel::ODateModel(const Reference<XMultiServiceFactory>& _rxFactory)
{
OSL_FAIL( "ODateModel::ODateModel: caught an exception!" );
}
osl_decrementInterlockedCount( &m_refCount );
osl_atomic_decrement( &m_refCount );
}
//------------------------------------------------------------------------------

View File

@@ -1184,14 +1184,14 @@ void SAL_CALL OControlModel::setPropertyValues( const Sequence< PropertyValue >&
void OControlModel::lockInstance( LockAccess )
{
m_aMutex.acquire();
osl_incrementInterlockedCount( &m_lockCount );
osl_atomic_increment( &m_lockCount );
}
//--------------------------------------------------------------------
oslInterlockedCount OControlModel::unlockInstance( LockAccess )
{
OSL_ENSURE( m_lockCount > 0, "OControlModel::unlockInstance: not locked!" );
oslInterlockedCount lockCount = osl_decrementInterlockedCount( &m_lockCount );
oslInterlockedCount lockCount = osl_atomic_decrement( &m_lockCount );
m_aMutex.release();
return lockCount;
}

View File

@@ -56,9 +56,9 @@ namespace {
class RefCountGuard: private boost::noncopyable {
public:
explicit RefCountGuard(oslInterlockedCount & count): count_(count)
{ osl_incrementInterlockedCount(&count_); }
{ osl_atomic_increment(&count_); }
~RefCountGuard() { osl_decrementInterlockedCount(&count_); }
~RefCountGuard() { osl_atomic_decrement(&count_); }
private:
oslInterlockedCount & count_;

View File

@@ -147,9 +147,9 @@ StringSequence SAL_CALL OFormsCollection::getSupportedServiceNames() throw(Runti
Reference< XCloneable > SAL_CALL OFormsCollection::createClone( ) throw (RuntimeException)
{
OFormsCollection* pClone = new OFormsCollection( *this );
osl_incrementInterlockedCount( &pClone->m_refCount );
osl_atomic_increment( &pClone->m_refCount );
pClone->clonedFrom( *this );
osl_decrementInterlockedCount( &pClone->m_refCount );
osl_atomic_decrement( &pClone->m_refCount );
return pClone;
}

View File

@@ -158,12 +158,12 @@ OGridControlModel::~OGridControlModel()
Reference< XCloneable > SAL_CALL OGridControlModel::createClone( ) throw (RuntimeException)
{
OGridControlModel* pClone = new OGridControlModel( this, getContext().getLegacyServiceFactory() );
osl_incrementInterlockedCount( &pClone->m_refCount );
osl_atomic_increment( &pClone->m_refCount );
pClone->OControlModel::clonedFrom( this );
// do not call OInterfaceContainer::clonedFrom, it would clone the elements aka columns, which is
// already done in the ctor
//pClone->OInterfaceContainer::clonedFrom( *this );
osl_decrementInterlockedCount( &pClone->m_refCount );
osl_atomic_decrement( &pClone->m_refCount );
return static_cast< XCloneable* >( static_cast< OControlModel* >( pClone ) );
}

View File

@@ -176,13 +176,13 @@ OImageControlModel::OImageControlModel( const OImageControlModel* _pOriginal, co
DBG_CTOR( OImageControlModel, NULL );
implConstruct();
osl_incrementInterlockedCount( &m_refCount );
osl_atomic_increment( &m_refCount );
{
// simulate a propertyChanged event for the ImageURL
::osl::MutexGuard aGuard( m_aMutex );
impl_handleNewImageURL_lck( eOther );
}
osl_decrementInterlockedCount( &m_refCount );
osl_atomic_decrement( &m_refCount );
}
//------------------------------------------------------------------

View File

@@ -495,14 +495,14 @@ namespace frm
//------------------------------------------------------------------------------
void OClickableImageBaseModel::implInitializeImageURL( )
{
osl_incrementInterlockedCount( &m_refCount );
osl_atomic_increment( &m_refCount );
{
// simulate a propertyChanged event for the ImageURL
Any aImageURL;
getFastPropertyValue( aImageURL, PROPERTY_ID_IMAGE_URL );
_propertyChanged( PropertyChangeEvent( *this, PROPERTY_IMAGE_URL, sal_False, PROPERTY_ID_IMAGE_URL, Any( ), aImageURL ) );
}
osl_decrementInterlockedCount( &m_refCount );
osl_atomic_decrement( &m_refCount );
}
//------------------------------------------------------------------------------

View File

@@ -106,11 +106,11 @@ namespace frm
if ( !m_xWindow.is() || !m_xModelProps.is() )
throw RuntimeException();
osl_incrementInterlockedCount( &m_refCount );
osl_atomic_increment( &m_refCount );
{
m_xWindow->addWindowListener( this );
}
osl_decrementInterlockedCount( &m_refCount );
osl_atomic_decrement( &m_refCount );
}
//--------------------------------------------------------------------

View File

@@ -60,13 +60,13 @@ namespace frm
//--------------------------------------------------------------------
oslInterlockedCount SAL_CALL ReferenceBase::acquire()
{
return osl_incrementInterlockedCount( &m_refCount );
return osl_atomic_increment( &m_refCount );
}
//--------------------------------------------------------------------
oslInterlockedCount SAL_CALL ReferenceBase::release()
{
return osl_decrementInterlockedCount( &m_refCount );
return osl_atomic_decrement( &m_refCount );
}
//--------------------------------------------------------------------