summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2012-09-22 01:51:12 -0500
committerNorbert Thiebaud <nthiebaud@gmail.com>2012-09-25 01:55:38 +0000
commit750fc206113a796035cbc05fb904fbae0eb771a8 (patch)
tree4ea1f0378c2b6d7f50480d3b9051de91780219cd /ucb
parentbcd2b017088822ea95e9d33d1d0dc360c0ec8d74 (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 'ucb')
-rw-r--r--ucb/source/ucp/tdoc/tdoc_stgelems.cxx22
-rw-r--r--ucb/source/ucp/tdoc/tdoc_storage.cxx6
-rw-r--r--ucb/source/ucp/webdav/DAVSession.hxx4
-rw-r--r--ucb/source/ucp/webdav/DAVSessionFactory.cxx6
-rw-r--r--ucb/workben/cachemap/cachemapobject1.cxx2
-rw-r--r--ucb/workben/cachemap/cachemapobject1.hxx2
-rw-r--r--ucb/workben/cachemap/cachemapobject3.cxx8
-rw-r--r--ucb/workben/cachemap/cachemapobject3.hxx2
8 files changed, 26 insertions, 26 deletions
diff --git a/ucb/source/ucp/tdoc/tdoc_stgelems.cxx b/ucb/source/ucp/tdoc/tdoc_stgelems.cxx
index ce097039415c..83c2f3260c5c 100644
--- a/ucb/source/ucp/tdoc/tdoc_stgelems.cxx
+++ b/ucb/source/ucp/tdoc/tdoc_stgelems.cxx
@@ -117,18 +117,18 @@ Storage::Storage( const uno::Reference< lang::XMultiServiceFactory > & xSMgr,
if ( m_xAggProxy.is() )
{
- osl_incrementInterlockedCount( &m_refCount );
+ osl_atomic_increment( &m_refCount );
{
// Solaris compiler problem:
// Extra block to enforce destruction of temporary object created
- // in next statement _before_ osl_decrementInterlockedCount is
+ // in next statement _before_ osl_atomic_decrement is
// called. Otherwise 'this' will destroy itself even before ctor
// is completed (See impl. of XInterface::release())!
m_xAggProxy->setDelegator(
static_cast< cppu::OWeakObject * >( this ) );
}
- osl_decrementInterlockedCount( &m_refCount );
+ osl_atomic_decrement( &m_refCount );
}
}
@@ -186,7 +186,7 @@ uno::Any SAL_CALL Storage::queryInterface( const uno::Type& aType )
void SAL_CALL Storage::acquire()
throw ()
{
- osl_incrementInterlockedCount( &m_refCount );
+ osl_atomic_increment( &m_refCount );
}
//=========================================================================
@@ -194,7 +194,7 @@ void SAL_CALL Storage::acquire()
void SAL_CALL Storage::release()
throw ()
{
- if ( osl_decrementInterlockedCount( &m_refCount ) == 0 )
+ if ( osl_atomic_decrement( &m_refCount ) == 0 )
{
m_xFactory->releaseElement( this );
delete this;
@@ -626,18 +626,18 @@ OutputStream::OutputStream(
if ( m_xAggProxy.is() )
{
- osl_incrementInterlockedCount( &m_refCount );
+ osl_atomic_increment( &m_refCount );
{
// Solaris compiler problem:
// Extra block to enforce destruction of temporary object created
- // in next statement _before_ osl_decrementInterlockedCount is
+ // in next statement _before_ osl_atomic_decrement is
// called. Otherwise 'this' will destroy itself even before ctor
// is completed (See impl. of XInterface::release())!
m_xAggProxy->setDelegator(
static_cast< cppu::OWeakObject * >( this ) );
}
- osl_decrementInterlockedCount( &m_refCount );
+ osl_atomic_decrement( &m_refCount );
}
}
@@ -827,18 +827,18 @@ Stream::Stream(
if ( m_xAggProxy.is() )
{
- osl_incrementInterlockedCount( &m_refCount );
+ osl_atomic_increment( &m_refCount );
{
// Solaris compiler problem:
// Extra block to enforce destruction of temporary object created
- // in next statement _before_ osl_decrementInterlockedCount is
+ // in next statement _before_ osl_atomic_decrement is
// called. Otherwise 'this' will destroy itself even before ctor
// is completed (See impl. of XInterface::release())!
m_xAggProxy->setDelegator(
static_cast< cppu::OWeakObject * >( this ) );
}
- osl_decrementInterlockedCount( &m_refCount );
+ osl_atomic_decrement( &m_refCount );
}
}
diff --git a/ucb/source/ucp/tdoc/tdoc_storage.cxx b/ucb/source/ucp/tdoc/tdoc_storage.cxx
index ca2a8ce7eca6..30deb334074f 100644
--- a/ucb/source/ucp/tdoc/tdoc_storage.cxx
+++ b/ucb/source/ucp/tdoc/tdoc_storage.cxx
@@ -204,15 +204,15 @@ StorageElementFactory::createStorage( const rtl::OUString & rUri,
xElement.release();
return aIt->second;
}
- else if ( osl_incrementInterlockedCount( &aIt->second->m_refCount ) > 1 )
+ else if ( osl_atomic_increment( &aIt->second->m_refCount ) > 1 )
{
rtl::Reference< Storage > xElement( aIt->second );
- osl_decrementInterlockedCount( &aIt->second->m_refCount );
+ osl_atomic_decrement( &aIt->second->m_refCount );
return aIt->second;
}
else
{
- osl_decrementInterlockedCount( &aIt->second->m_refCount );
+ osl_atomic_decrement( &aIt->second->m_refCount );
aIt->second->m_aContainerIt = m_aMap.end();
uno::Reference< embed::XStorage > xParentStorage;
diff --git a/ucb/source/ucp/webdav/DAVSession.hxx b/ucb/source/ucp/webdav/DAVSession.hxx
index bd854ff7831c..120879d91bf8 100644
--- a/ucb/source/ucp/webdav/DAVSession.hxx
+++ b/ucb/source/ucp/webdav/DAVSession.hxx
@@ -56,12 +56,12 @@ class DAVSession
public:
inline void acquire() SAL_THROW(())
{
- osl_incrementInterlockedCount( &m_nRefCount );
+ osl_atomic_increment( &m_nRefCount );
}
void release() SAL_THROW(())
{
- if ( osl_decrementInterlockedCount( &m_nRefCount ) == 0 )
+ if ( osl_atomic_decrement( &m_nRefCount ) == 0 )
{
m_xFactory->releaseElement( this );
delete this;
diff --git a/ucb/source/ucp/webdav/DAVSessionFactory.cxx b/ucb/source/ucp/webdav/DAVSessionFactory.cxx
index 41e19ae1b22f..661799ae58d8 100644
--- a/ucb/source/ucp/webdav/DAVSessionFactory.cxx
+++ b/ucb/source/ucp/webdav/DAVSessionFactory.cxx
@@ -74,15 +74,15 @@ rtl::Reference< DAVSession > DAVSessionFactory::createDAVSession(
xElement.release();
return aIt->second;
}
- else if ( osl_incrementInterlockedCount( &aIt->second->m_nRefCount ) > 1 )
+ else if ( osl_atomic_increment( &aIt->second->m_nRefCount ) > 1 )
{
rtl::Reference< DAVSession > xElement( aIt->second );
- osl_decrementInterlockedCount( &aIt->second->m_nRefCount );
+ osl_atomic_decrement( &aIt->second->m_nRefCount );
return xElement;
}
else
{
- osl_decrementInterlockedCount( &aIt->second->m_nRefCount );
+ osl_atomic_decrement( &aIt->second->m_nRefCount );
aIt->second->m_aContainerIt = m_aMap.end();
// If URL scheme is different from http or https we definitely
diff --git a/ucb/workben/cachemap/cachemapobject1.cxx b/ucb/workben/cachemap/cachemapobject1.cxx
index fdd05c5d8c0f..7e5b5b4ff836 100644
--- a/ucb/workben/cachemap/cachemapobject1.cxx
+++ b/ucb/workben/cachemap/cachemapobject1.cxx
@@ -46,7 +46,7 @@ void ObjectContainer1::releaseElement(Object1 * pElement) SAL_THROW(())
bool bDelete = false;
{
osl::MutexGuard aGuard(m_aMutex);
- if (osl_decrementInterlockedCount(&pElement->m_nRefCount) == 0)
+ if (osl_atomic_decrement(&pElement->m_nRefCount) == 0)
{
m_aMap.erase(pElement->m_aContainerIt);
bDelete = true;
diff --git a/ucb/workben/cachemap/cachemapobject1.hxx b/ucb/workben/cachemap/cachemapobject1.hxx
index 34b7e5e47662..7e20a4eaa757 100644
--- a/ucb/workben/cachemap/cachemapobject1.hxx
+++ b/ucb/workben/cachemap/cachemapobject1.hxx
@@ -58,7 +58,7 @@ class Object1
{
public:
inline void acquire() SAL_THROW(())
- { osl_incrementInterlockedCount(&m_nRefCount); }
+ { osl_atomic_increment(&m_nRefCount); }
inline void release() SAL_THROW(())
{ m_xContainer->releaseElement(this); }
diff --git a/ucb/workben/cachemap/cachemapobject3.cxx b/ucb/workben/cachemap/cachemapobject3.cxx
index b7cb5552b402..7ecd50a9ff60 100644
--- a/ucb/workben/cachemap/cachemapobject3.cxx
+++ b/ucb/workben/cachemap/cachemapobject3.cxx
@@ -42,7 +42,7 @@ inline Object3::~Object3() SAL_THROW(())
void Object3::release() SAL_THROW(())
{
- if (osl_decrementInterlockedCount(&m_nRefCount) == 0)
+ if (osl_atomic_decrement(&m_nRefCount) == 0)
{
m_xContainer->releaseElement(this);
delete this;
@@ -75,15 +75,15 @@ rtl::Reference< Object3 > ObjectContainer3::get(rtl::OUString const & rKey)
xElement.release();
return aIt->second;
}
- else if (osl_incrementInterlockedCount(&aIt->second->m_nRefCount) > 1)
+ else if (osl_atomic_increment(&aIt->second->m_nRefCount) > 1)
{
rtl::Reference< Object3 > xElement(aIt->second);
- osl_decrementInterlockedCount(&aIt->second->m_nRefCount);
+ osl_atomic_decrement(&aIt->second->m_nRefCount);
return xElement;
}
else
{
- osl_decrementInterlockedCount(&aIt->second->m_nRefCount);
+ osl_atomic_decrement(&aIt->second->m_nRefCount);
aIt->second->m_aContainerIt = m_aMap.end();
aIt->second = new Object3(this);
aIt->second->m_aContainerIt = aIt;
diff --git a/ucb/workben/cachemap/cachemapobject3.hxx b/ucb/workben/cachemap/cachemapobject3.hxx
index 279436d4b74d..181e18dc503b 100644
--- a/ucb/workben/cachemap/cachemapobject3.hxx
+++ b/ucb/workben/cachemap/cachemapobject3.hxx
@@ -58,7 +58,7 @@ class Object3
{
public:
inline void acquire() SAL_THROW(())
- { osl_incrementInterlockedCount(&m_nRefCount); }
+ { osl_atomic_increment(&m_nRefCount); }
void release() SAL_THROW(());