summaryrefslogtreecommitdiff
path: root/cppu
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2012-09-16 02:00:14 -0500
committerNorbert Thiebaud <nthiebaud@gmail.com>2012-09-17 14:26:12 +0000
commit195f17ee40003f0ff74d08fecf5d68afe9cb1036 (patch)
treebeca88d96ae704d4ecb03defd9390b1a05a24c47 /cppu
parentc9d3373dadc1fbb36a6cf62661f0ec59b313d74b (diff)
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 'cppu')
-rw-r--r--cppu/inc/com/sun/star/uno/Sequence.hxx2
-rw-r--r--cppu/qa/test_any.cxx4
-rw-r--r--cppu/qa/test_reference.cxx4
-rw-r--r--cppu/source/helper/purpenv/helper_purpenv_Environment.cxx6
-rw-r--r--cppu/source/helper/purpenv/helper_purpenv_Mapping.cxx4
-rw-r--r--cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx4
-rw-r--r--cppu/source/typelib/typelib.cxx73
-rw-r--r--cppu/source/uno/IdentityMapping.cxx4
-rw-r--r--cppu/source/uno/assign.hxx6
-rw-r--r--cppu/source/uno/cascade_mapping.cxx4
-rw-r--r--cppu/source/uno/copy.hxx4
-rw-r--r--cppu/source/uno/destr.hxx2
-rw-r--r--cppu/source/uno/lbenv.cxx16
-rw-r--r--cppu/source/uno/lbmap.cxx4
-rw-r--r--cppu/source/uno/prim.hxx4
-rw-r--r--cppu/source/uno/sequence.cxx10
16 files changed, 70 insertions, 81 deletions
diff --git a/cppu/inc/com/sun/star/uno/Sequence.hxx b/cppu/inc/com/sun/star/uno/Sequence.hxx
index 073bbce7ec24..498109a0321c 100644
--- a/cppu/inc/com/sun/star/uno/Sequence.hxx
+++ b/cppu/inc/com/sun/star/uno/Sequence.hxx
@@ -56,7 +56,7 @@ inline Sequence< E >::Sequence() SAL_THROW(())
template< class E >
inline Sequence< E >::Sequence( const Sequence< E > & rSeq ) SAL_THROW(())
{
- ::osl_incrementInterlockedCount( &rSeq._pSequence->nRefCount );
+ osl_atomic_increment( &rSeq._pSequence->nRefCount );
_pSequence = rSeq._pSequence;
}
diff --git a/cppu/qa/test_any.cxx b/cppu/qa/test_any.cxx
index 3bb86f629f51..05a07b85c7a2 100644
--- a/cppu/qa/test_any.cxx
+++ b/cppu/qa/test_any.cxx
@@ -66,13 +66,13 @@ public:
Base(): m_count(0) {}
void acquire() {
- if (osl_incrementInterlockedCount(&m_count) == SAL_MAX_INT32) {
+ if (osl_atomic_increment(&m_count) == SAL_MAX_INT32) {
abort();
}
}
void release() {
- if (osl_decrementInterlockedCount(&m_count) == 0) {
+ if (osl_atomic_decrement(&m_count) == 0) {
delete this;
}
}
diff --git a/cppu/qa/test_reference.cxx b/cppu/qa/test_reference.cxx
index 6fc2cfea0263..b998238f6b39 100644
--- a/cppu/qa/test_reference.cxx
+++ b/cppu/qa/test_reference.cxx
@@ -67,12 +67,12 @@ public:
virtual void SAL_CALL acquire() throw ()
{
- osl_incrementInterlockedCount( &m_refCount );
+ osl_atomic_increment( &m_refCount );
}
virtual void SAL_CALL release() throw ()
{
- if ( 0 == osl_decrementInterlockedCount( &m_refCount ) )
+ if ( 0 == osl_atomic_decrement( &m_refCount ) )
delete this;
}
diff --git a/cppu/source/helper/purpenv/helper_purpenv_Environment.cxx b/cppu/source/helper/purpenv/helper_purpenv_Environment.cxx
index 602d0d2a4618..15946d7558de 100644
--- a/cppu/source/helper/purpenv/helper_purpenv_Environment.cxx
+++ b/cppu/source/helper/purpenv/helper_purpenv_Environment.cxx
@@ -284,12 +284,12 @@ void Base::acquire(void)
{
m_env_acquire(m_pEnv);
- osl_incrementInterlockedCount(&m_nRef);
+ osl_atomic_increment(&m_nRef);
}
void Base::release(void)
{
- if (osl_decrementInterlockedCount(&m_nRef) == 0)
+ if (osl_atomic_decrement(&m_nRef) == 0)
delete this;
else
@@ -299,7 +299,7 @@ void Base::release(void)
void Base::harden(uno_Environment ** ppHardEnv)
{
m_env_harden(ppHardEnv, m_pEnv);
- osl_incrementInterlockedCount(&m_nRef);
+ osl_atomic_increment(&m_nRef);
}
void Base::acquireWeak(void)
diff --git a/cppu/source/helper/purpenv/helper_purpenv_Mapping.cxx b/cppu/source/helper/purpenv/helper_purpenv_Mapping.cxx
index 1bd82d328eef..074b8a1efcae 100644
--- a/cppu/source/helper/purpenv/helper_purpenv_Mapping.cxx
+++ b/cppu/source/helper/purpenv/helper_purpenv_Mapping.cxx
@@ -191,7 +191,7 @@ void Mapping::mapInterface(
void Mapping::acquire() SAL_THROW(())
{
- if (osl_incrementInterlockedCount(&m_nCount) == 1)
+ if (osl_atomic_increment(&m_nCount) == 1)
{
uno_Mapping * pMapping = this;
@@ -201,7 +201,7 @@ void Mapping::acquire() SAL_THROW(())
void Mapping::release() SAL_THROW(())
{
- if (osl_decrementInterlockedCount(&m_nCount) == 0)
+ if (osl_atomic_decrement(&m_nCount) == 0)
::uno_revokeMapping(this);
}
diff --git a/cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx b/cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx
index 989dadac33d4..f0706e190dbb 100644
--- a/cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx
+++ b/cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx
@@ -307,7 +307,7 @@ void Proxy::acquire(void)
NULL,
NULL);
- if (osl_incrementInterlockedCount(&m_nRef) == 1)
+ if (osl_atomic_increment(&m_nRef) == 1)
{
// rebirth of proxy zombie
void * pThis = this;
@@ -350,7 +350,7 @@ void Proxy::release(void)
NULL,
NULL);
- if (osl_decrementInterlockedCount(&m_nRef) == 0)
+ if (osl_atomic_decrement(&m_nRef) == 0)
m_from.get()->pExtEnv->revokeInterface(m_from.get()->pExtEnv, this);
if (probeFun)
diff --git a/cppu/source/typelib/typelib.cxx b/cppu/source/typelib/typelib.cxx
index 128c4b2e7c1c..9eda378609f5 100644
--- a/cppu/source/typelib/typelib.cxx
+++ b/cppu/source/typelib/typelib.cxx
@@ -601,8 +601,7 @@ extern "C" void SAL_CALL typelib_typedescription_newEmpty(
typelib_IndirectTypeDescription * pIndirect = (typelib_IndirectTypeDescription *)pTmp;
pRet = (typelib_TypeDescription *)pTmp;
#if OSL_DEBUG_LEVEL > 1
- osl_incrementInterlockedCount(
- &Init::get().nArrayTypeDescriptionCount );
+ osl_atomic_increment( &Init::get().nArrayTypeDescriptionCount );
#endif
pIndirect->pType = 0;
pTmp->nDimensions = 0;
@@ -616,8 +615,7 @@ extern "C" void SAL_CALL typelib_typedescription_newEmpty(
typelib_IndirectTypeDescription * pTmp = new typelib_IndirectTypeDescription();
pRet = (typelib_TypeDescription *)pTmp;
#if OSL_DEBUG_LEVEL > 1
- osl_incrementInterlockedCount(
- &Init::get().nIndirectTypeDescriptionCount );
+ osl_atomic_increment( &Init::get().nIndirectTypeDescriptionCount );
#endif
pTmp->pType = 0;
}
@@ -629,8 +627,7 @@ extern "C" void SAL_CALL typelib_typedescription_newEmpty(
pTmp = new typelib_UnionTypeDescription();
pRet = (typelib_TypeDescription *)pTmp;
#if OSL_DEBUG_LEVEL > 1
- osl_incrementInterlockedCount(
- &Init::get().nUnionTypeDescriptionCount );
+ osl_atomic_increment( &Init::get().nUnionTypeDescriptionCount );
#endif
pTmp->nMembers = 0;
pTmp->pDiscriminantTypeRef = 0;
@@ -648,8 +645,7 @@ extern "C" void SAL_CALL typelib_typedescription_newEmpty(
pTmp = new typelib_StructTypeDescription();
pRet = (typelib_TypeDescription *)pTmp;
#if OSL_DEBUG_LEVEL > 1
- osl_incrementInterlockedCount(
- &Init::get().nCompoundTypeDescriptionCount );
+ osl_atomic_increment( &Init::get().nCompoundTypeDescriptionCount );
#endif
pTmp->aBase.pBaseTypeDescription = 0;
pTmp->aBase.nMembers = 0;
@@ -667,8 +663,7 @@ extern "C" void SAL_CALL typelib_typedescription_newEmpty(
pTmp = new typelib_CompoundTypeDescription();
pRet = (typelib_TypeDescription *)pTmp;
#if OSL_DEBUG_LEVEL > 1
- osl_incrementInterlockedCount(
- &Init::get().nCompoundTypeDescriptionCount );
+ osl_atomic_increment( &Init::get().nCompoundTypeDescriptionCount );
#endif
pTmp->pBaseTypeDescription = 0;
pTmp->nMembers = 0;
@@ -683,8 +678,7 @@ extern "C" void SAL_CALL typelib_typedescription_newEmpty(
typelib_EnumTypeDescription * pTmp = new typelib_EnumTypeDescription();
pRet = (typelib_TypeDescription *)pTmp;
#if OSL_DEBUG_LEVEL > 1
- osl_incrementInterlockedCount(
- &Init::get().nEnumTypeDescriptionCount );
+ osl_atomic_increment( &Init::get().nEnumTypeDescriptionCount );
#endif
pTmp->nDefaultEnumValue = 0;
pTmp->nEnumValues = 0;
@@ -698,8 +692,7 @@ extern "C" void SAL_CALL typelib_typedescription_newEmpty(
typelib_InterfaceTypeDescription * pTmp = new typelib_InterfaceTypeDescription();
pRet = (typelib_TypeDescription *)pTmp;
#if OSL_DEBUG_LEVEL > 1
- osl_incrementInterlockedCount(
- &Init::get().nInterfaceTypeDescriptionCount );
+ osl_atomic_increment( &Init::get().nInterfaceTypeDescriptionCount );
#endif
pTmp->pBaseTypeDescription = 0;
pTmp->nMembers = 0;
@@ -719,8 +712,7 @@ extern "C" void SAL_CALL typelib_typedescription_newEmpty(
typelib_InterfaceMethodTypeDescription * pTmp = new typelib_InterfaceMethodTypeDescription();
pRet = (typelib_TypeDescription *)pTmp;
#if OSL_DEBUG_LEVEL > 1
- osl_incrementInterlockedCount(
- &Init::get().nInterfaceMethodTypeDescriptionCount );
+ osl_atomic_increment( &Init::get().nInterfaceMethodTypeDescriptionCount );
#endif
pTmp->aBase.pMemberName = 0;
pTmp->pReturnTypeRef = 0;
@@ -739,8 +731,7 @@ extern "C" void SAL_CALL typelib_typedescription_newEmpty(
typelib_InterfaceAttributeTypeDescription * pTmp = new typelib_InterfaceAttributeTypeDescription();
pRet = (typelib_TypeDescription *)pTmp;
#if OSL_DEBUG_LEVEL > 1
- osl_incrementInterlockedCount(
- &Init::get().nInterfaceAttributeTypeDescriptionCount );
+ osl_atomic_increment( &Init::get().nInterfaceAttributeTypeDescriptionCount );
#endif
pTmp->aBase.pMemberName = 0;
pTmp->pAttributeTypeRef = 0;
@@ -758,7 +749,7 @@ extern "C" void SAL_CALL typelib_typedescription_newEmpty(
{
pRet = new typelib_TypeDescription();
#if OSL_DEBUG_LEVEL > 1
- osl_incrementInterlockedCount( &Init::get().nTypeDescriptionCount );
+ osl_atomic_increment( &Init::get().nTypeDescriptionCount );
#endif
}
}
@@ -1429,7 +1420,7 @@ extern "C" CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_acquire(
typelib_TypeDescription * pTypeDescription )
SAL_THROW_EXTERN_C()
{
- ::osl_incrementInterlockedCount( &pTypeDescription->nRefCount );
+ osl_atomic_increment( &pTypeDescription->nRefCount );
}
//------------------------------------------------------------------------
@@ -1586,7 +1577,7 @@ extern "C" CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_release(
typelib_TypeDescription * pTD )
SAL_THROW_EXTERN_C()
{
- sal_Int32 ref = ::osl_decrementInterlockedCount( &pTD->nRefCount );
+ sal_Int32 ref = osl_atomic_decrement( &pTD->nRefCount );
OSL_ASSERT(ref >= 0);
if (0 == ref)
{
@@ -1625,32 +1616,32 @@ extern "C" CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_release(
switch( pTD->eTypeClass )
{
case typelib_TypeClass_ARRAY:
- osl_decrementInterlockedCount( &rInit.nArrayTypeDescriptionCount );
+ osl_atomic_decrement( &rInit.nArrayTypeDescriptionCount );
break;
case typelib_TypeClass_SEQUENCE:
- osl_decrementInterlockedCount( &rInit.nIndirectTypeDescriptionCount );
+ osl_atomic_decrement( &rInit.nIndirectTypeDescriptionCount );
break;
case typelib_TypeClass_UNION:
- osl_decrementInterlockedCount( &rInit.nUnionTypeDescriptionCount );
+ osl_atomic_decrement( &rInit.nUnionTypeDescriptionCount );
break;
case typelib_TypeClass_STRUCT:
case typelib_TypeClass_EXCEPTION:
- osl_decrementInterlockedCount( &rInit.nCompoundTypeDescriptionCount );
+ osl_atomic_decrement( &rInit.nCompoundTypeDescriptionCount );
break;
case typelib_TypeClass_INTERFACE:
- osl_decrementInterlockedCount( &rInit.nInterfaceTypeDescriptionCount );
+ osl_atomic_decrement( &rInit.nInterfaceTypeDescriptionCount );
break;
case typelib_TypeClass_INTERFACE_METHOD:
- osl_decrementInterlockedCount( &rInit.nInterfaceMethodTypeDescriptionCount );
+ osl_atomic_decrement( &rInit.nInterfaceMethodTypeDescriptionCount );
break;
case typelib_TypeClass_INTERFACE_ATTRIBUTE:
- osl_decrementInterlockedCount( &rInit.nInterfaceAttributeTypeDescriptionCount );
+ osl_atomic_decrement( &rInit.nInterfaceAttributeTypeDescriptionCount );
break;
case typelib_TypeClass_ENUM:
- osl_decrementInterlockedCount( &rInit.nEnumTypeDescriptionCount );
+ osl_atomic_decrement( &rInit.nEnumTypeDescriptionCount );
break;
default:
- osl_decrementInterlockedCount( &rInit.nTypeDescriptionCount );
+ osl_atomic_decrement( &rInit.nTypeDescriptionCount );
}
#endif
@@ -1681,7 +1672,7 @@ extern "C" CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_register(
// pRef->pType->pWeakRef == 0 means that the description is empty
if (pTDR->pType->pWeakRef)
{
- if (osl_incrementInterlockedCount( &pTDR->pType->nRefCount ) > 1)
+ if (osl_atomic_increment( &pTDR->pType->nRefCount ) > 1)
{
// The refence is incremented. The object cannot be destroyed.
// Release the guard at the earliest point.
@@ -1694,7 +1685,7 @@ extern "C" CPPU_DLLPUBLIC void SAL_CALL typelib_typedescription_register(
else
{
// destruction of this type in progress (another thread!)
- osl_decrementInterlockedCount( &pTDR->pType->nRefCount );
+ osl_atomic_decrement( &pTDR->pType->nRefCount );
}
}
// take new descr
@@ -2353,7 +2344,7 @@ extern "C" CPPU_DLLPUBLIC void SAL_CALL typelib_typedescriptionreference_new(
{
typelib_TypeDescriptionReference * pTDR = new typelib_TypeDescriptionReference();
#if OSL_DEBUG_LEVEL > 1
- osl_incrementInterlockedCount( &rInit.nTypeDescriptionReferenceCount );
+ osl_atomic_increment( &rInit.nTypeDescriptionReferenceCount );
#endif
pTDR->nRefCount = 1;
pTDR->nStaticRefCount = 0;
@@ -2384,7 +2375,7 @@ extern "C" CPPU_DLLPUBLIC void SAL_CALL typelib_typedescriptionreference_acquire
typelib_TypeDescriptionReference * pRef )
SAL_THROW_EXTERN_C()
{
- ::osl_incrementInterlockedCount( &pRef->nRefCount );
+ osl_atomic_increment( &pRef->nRefCount );
}
//------------------------------------------------------------------------
@@ -2395,7 +2386,7 @@ extern "C" CPPU_DLLPUBLIC void SAL_CALL typelib_typedescriptionreference_release
// Is it a type description?
if( reallyWeak( pRef->eTypeClass ) )
{
- if( ! ::osl_decrementInterlockedCount( &pRef->nRefCount ) )
+ if( ! osl_atomic_decrement( &pRef->nRefCount ) )
{
TypeDescriptor_Init_Impl &rInit = Init::get();
if( rInit.pWeakMap )
@@ -2412,7 +2403,7 @@ extern "C" CPPU_DLLPUBLIC void SAL_CALL typelib_typedescriptionreference_release
rtl_uString_release( pRef->pTypeName );
OSL_ASSERT( pRef->pType == 0 );
#if OSL_DEBUG_LEVEL > 1
- osl_decrementInterlockedCount( &rInit.nTypeDescriptionReferenceCount );
+ osl_atomic_decrement( &rInit.nTypeDescriptionReferenceCount );
#endif
delete pRef;
}
@@ -2437,7 +2428,7 @@ extern "C" CPPU_DLLPUBLIC void SAL_CALL typelib_typedescriptionreference_getDesc
if( !reallyWeak( pRef->eTypeClass ) && pRef->pType && pRef->pType->pWeakRef )
{
// reference is a description and initialized
- osl_incrementInterlockedCount( &((typelib_TypeDescription *)pRef)->nRefCount );
+ osl_atomic_increment( &((typelib_TypeDescription *)pRef)->nRefCount );
*ppRet = (typelib_TypeDescription *)pRef;
return;
}
@@ -2447,7 +2438,7 @@ extern "C" CPPU_DLLPUBLIC void SAL_CALL typelib_typedescriptionreference_getDesc
// pRef->pType->pWeakRef == 0 means that the description is empty
if( pRef->pType && pRef->pType->pWeakRef )
{
- sal_Int32 n = ::osl_incrementInterlockedCount( &pRef->pType->nRefCount );
+ sal_Int32 n = osl_atomic_increment( &pRef->pType->nRefCount );
if( n > 1 )
{
// The refence is incremented. The object cannot be destroyed.
@@ -2457,7 +2448,7 @@ extern "C" CPPU_DLLPUBLIC void SAL_CALL typelib_typedescriptionreference_getDesc
}
else
{
- ::osl_decrementInterlockedCount( &pRef->pType->nRefCount );
+ osl_atomic_decrement( &pRef->pType->nRefCount );
// detruction of this type in progress (another thread!)
// no acces through this weak reference
pRef->pType = 0;
@@ -2489,7 +2480,7 @@ extern "C" void SAL_CALL typelib_typedescriptionreference_getByName(
WeakMap_Impl::const_iterator aIt = rInit.pWeakMap->find( (sal_Unicode*)pName->buffer );
if( !(aIt == rInit.pWeakMap->end()) ) // != failed on msc4.2
{
- sal_Int32 n = ::osl_incrementInterlockedCount( &(*aIt).second->nRefCount );
+ sal_Int32 n = osl_atomic_increment( &(*aIt).second->nRefCount );
if( n > 1 )
{
// The refence is incremented. The object cannot be destroyed.
@@ -2500,7 +2491,7 @@ extern "C" void SAL_CALL typelib_typedescriptionreference_getByName(
{
// detruction of this type in progress (another thread!)
// no acces through this weak reference
- ::osl_decrementInterlockedCount( &(*aIt).second->nRefCount );
+ osl_atomic_decrement( &(*aIt).second->nRefCount );
}
}
}
diff --git a/cppu/source/uno/IdentityMapping.cxx b/cppu/source/uno/IdentityMapping.cxx
index f3b0f440565e..bf59a8534959 100644
--- a/cppu/source/uno/IdentityMapping.cxx
+++ b/cppu/source/uno/IdentityMapping.cxx
@@ -47,7 +47,7 @@ static void SAL_CALL s_acquire(uno_Mapping * pMapping) SAL_THROW(())
{
static rtl::OUString s_purpose;
- if (1 == ::osl_incrementInterlockedCount(&static_cast<IdentityMapping *>(pMapping)->m_nRef))
+ if (1 == osl_atomic_increment(&static_cast<IdentityMapping *>(pMapping)->m_nRef))
{
uno_registerMapping(
&pMapping,
@@ -60,7 +60,7 @@ static void SAL_CALL s_acquire(uno_Mapping * pMapping) SAL_THROW(())
static void SAL_CALL s_release(uno_Mapping * pMapping) SAL_THROW(())
{
- if (!::osl_decrementInterlockedCount(&static_cast<IdentityMapping *>(pMapping )->m_nRef))
+ if (!osl_atomic_decrement(&static_cast<IdentityMapping *>(pMapping )->m_nRef))
uno_revokeMapping(pMapping);
}
diff --git a/cppu/source/uno/assign.hxx b/cppu/source/uno/assign.hxx
index a6ba011e07ab..66b065cb834b 100644
--- a/cppu/source/uno/assign.hxx
+++ b/cppu/source/uno/assign.hxx
@@ -196,8 +196,7 @@ inline sal_Bool _assignArray(
case typelib_TypeClass_SEQUENCE:
for (i=0; i < nTotalElements; i++)
{
- ::osl_incrementInterlockedCount(
- &(*((uno_Sequence **)pSource + i))->nRefCount );
+ osl_atomic_increment( &(*((uno_Sequence **)pSource + i))->nRefCount );
idestructSequence(
*((uno_Sequence **)pDest + i),
pElementTypeRef, pElementTypeDescr, release );
@@ -566,8 +565,7 @@ inline sal_Bool _assignData(
return sal_True;
if (_type_equals( pDestType, pSourceType ))
{
- ::osl_incrementInterlockedCount(
- &(*(uno_Sequence **)pSource)->nRefCount );
+ osl_atomic_increment( &(*(uno_Sequence **)pSource)->nRefCount );
idestructSequence(
*(uno_Sequence **)pDest, pDestType, pDestTypeDescr, release );
*(uno_Sequence **)pDest = *(uno_Sequence **)pSource;
diff --git a/cppu/source/uno/cascade_mapping.cxx b/cppu/source/uno/cascade_mapping.cxx
index 7263208200ea..08d65ea5ab5d 100644
--- a/cppu/source/uno/cascade_mapping.cxx
+++ b/cppu/source/uno/cascade_mapping.cxx
@@ -115,14 +115,14 @@ void MediatorMapping::acquire(void)
{
LOG_LIFECYLE_MediatorMapping_emit(std::cerr << __FUNCTION__ << std::endl);
- osl_incrementInterlockedCount(&m_refCount);
+ osl_atomic_increment(&m_refCount);
}
void MediatorMapping::release(void)
{
LOG_LIFECYLE_MediatorMapping_emit(std::cerr << __FUNCTION__ << std::endl);
- if (osl_decrementInterlockedCount(&m_refCount) == 0)
+ if (osl_atomic_decrement(&m_refCount) == 0)
{
::uno_revokeMapping(this);
}
diff --git a/cppu/source/uno/copy.hxx b/cppu/source/uno/copy.hxx
index 8986dc020231..ce46492bfce4 100644
--- a/cppu/source/uno/copy.hxx
+++ b/cppu/source/uno/copy.hxx
@@ -506,7 +506,7 @@ inline uno_Sequence * icopyConstructSequence(
(eTypeClass <= typelib_TypeClass_ENUM &&
eTypeClass != typelib_TypeClass_ANY))
{
- ::osl_incrementInterlockedCount( &pSource->nRefCount );
+ osl_atomic_increment( &pSource->nRefCount );
return pSource;
}
else // create new sequence
@@ -828,7 +828,7 @@ inline void _copyConstructData(
}
else
{
- ::osl_incrementInterlockedCount( &(*(uno_Sequence **)pSource)->nRefCount );
+ osl_atomic_increment( &(*(uno_Sequence **)pSource)->nRefCount );
*(uno_Sequence **)pDest = *(uno_Sequence **)pSource;
}
break;
diff --git a/cppu/source/uno/destr.hxx b/cppu/source/uno/destr.hxx
index 62ea60b3fb25..ec73ff0a7172 100644
--- a/cppu/source/uno/destr.hxx
+++ b/cppu/source/uno/destr.hxx
@@ -327,7 +327,7 @@ inline void idestructSequence(
typelib_TypeDescription * pTypeDescr,
uno_ReleaseFunc release )
{
- if (::osl_decrementInterlockedCount( &pSeq->nRefCount ) == 0)
+ if (osl_atomic_decrement( &pSeq->nRefCount ) == 0)
{
if (pSeq->nElements > 0)
{
diff --git a/cppu/source/uno/lbenv.cxx b/cppu/source/uno/lbenv.cxx
index 3358fe971e7f..ff6de9a9a815 100644
--- a/cppu/source/uno/lbenv.cxx
+++ b/cppu/source/uno/lbenv.cxx
@@ -537,15 +537,15 @@ static void SAL_CALL defenv_getRegisteredInterfaces(
static void SAL_CALL defenv_acquire( uno_Environment * pEnv )
{
uno_DefaultEnvironment * that = (uno_DefaultEnvironment *)pEnv;
- ::osl_incrementInterlockedCount( &that->nWeakRef );
- ::osl_incrementInterlockedCount( &that->nRef );
+ osl_atomic_increment( &that->nWeakRef );
+ osl_atomic_increment( &that->nRef );
}
//------------------------------------------------------------------------------
static void SAL_CALL defenv_release( uno_Environment * pEnv )
{
uno_DefaultEnvironment * that = (uno_DefaultEnvironment *)pEnv;
- if (! ::osl_decrementInterlockedCount( &that->nRef ))
+ if (! osl_atomic_decrement( &that->nRef ))
{
// invoke dispose callback
if (pEnv->environmentDisposing)
@@ -556,7 +556,7 @@ static void SAL_CALL defenv_release( uno_Environment * pEnv )
OSL_ENSURE( that->aOId2ObjectMap.empty(), "### object entries left!" );
}
// free memory if no weak refs left
- if (! ::osl_decrementInterlockedCount( &that->nWeakRef ))
+ if (! osl_atomic_decrement( &that->nWeakRef ))
{
delete that;
}
@@ -566,14 +566,14 @@ static void SAL_CALL defenv_release( uno_Environment * pEnv )
static void SAL_CALL defenv_acquireWeak( uno_Environment * pEnv )
{
uno_DefaultEnvironment * that = (uno_DefaultEnvironment *)pEnv;
- ::osl_incrementInterlockedCount( &that->nWeakRef );
+ osl_atomic_increment( &that->nWeakRef );
}
//------------------------------------------------------------------------------
static void SAL_CALL defenv_releaseWeak( uno_Environment * pEnv )
{
uno_DefaultEnvironment * that = (uno_DefaultEnvironment *)pEnv;
- if (! ::osl_decrementInterlockedCount( &that->nWeakRef ))
+ if (! osl_atomic_decrement( &that->nWeakRef ))
{
delete that;
}
@@ -597,13 +597,13 @@ static void SAL_CALL defenv_harden(
uno_DefaultEnvironment * that = (uno_DefaultEnvironment *)pEnv;
{
::osl::MutexGuard guard( rData.mutex );
- if (1 == ::osl_incrementInterlockedCount( &that->nRef )) // is dead
+ if (1 == osl_atomic_increment( &that->nRef )) // is dead
{
that->nRef = 0;
return;
}
}
- ::osl_incrementInterlockedCount( &that->nWeakRef );
+ osl_atomic_increment( &that->nWeakRef );
*ppHardEnv = pEnv;
}
diff --git a/cppu/source/uno/lbmap.cxx b/cppu/source/uno/lbmap.cxx
index a542948b2bbd..25d38b695642 100644
--- a/cppu/source/uno/lbmap.cxx
+++ b/cppu/source/uno/lbmap.cxx
@@ -205,7 +205,7 @@ static void SAL_CALL mediate_free( uno_Mapping * pMapping )
static void SAL_CALL mediate_acquire( uno_Mapping * pMapping )
SAL_THROW(())
{
- if (1 == ::osl_incrementInterlockedCount(
+ if (1 == ::osl_atomic_increment(
& static_cast< uno_Mediate_Mapping * >( pMapping )->nRef ))
{
uno_registerMapping(
@@ -219,7 +219,7 @@ static void SAL_CALL mediate_acquire( uno_Mapping * pMapping )
static void SAL_CALL mediate_release( uno_Mapping * pMapping )
SAL_THROW(())
{
- if (! ::osl_decrementInterlockedCount(
+ if (! ::osl_atomic_decrement(
& static_cast< uno_Mediate_Mapping * >( pMapping )->nRef ))
{
uno_revokeMapping( pMapping );
diff --git a/cppu/source/uno/prim.hxx b/cppu/source/uno/prim.hxx
index 3d2edde44f50..b40dac398eb3 100644
--- a/cppu/source/uno/prim.hxx
+++ b/cppu/source/uno/prim.hxx
@@ -116,7 +116,7 @@ inline sal_uInt32 calcSeqMemSize(
//--------------------------------------------------------------------------------------------------
inline uno_Sequence * createEmptySequence() SAL_THROW(())
{
- ::osl_incrementInterlockedCount( &g_emptySeq.nRefCount );
+ osl_atomic_increment( &g_emptySeq.nRefCount );
return &g_emptySeq;
}
//--------------------------------------------------------------------------------------------------
@@ -144,7 +144,7 @@ inline typelib_TypeDescriptionReference * _getVoidType()
//--------------------------------------------------------------------------------------------------
#define TYPE_ACQUIRE( pType ) \
- ::osl_incrementInterlockedCount( &(pType)->nRefCount );
+ osl_atomic_increment( &(pType)->nRefCount );
//--------------------------------------------------------------------------------------------------
extern "C" void * binuno_queryInterface(
diff --git a/cppu/source/uno/sequence.cxx b/cppu/source/uno/sequence.cxx
index c62325cc3c39..d9e28fb7f9ad 100644
--- a/cppu/source/uno/sequence.cxx
+++ b/cppu/source/uno/sequence.cxx
@@ -720,7 +720,7 @@ static inline bool ireallocSequence(
if (ret)
{
// destruct sequence
- if (osl_decrementInterlockedCount( &pSeq->nRefCount ) == 0)
+ if (osl_atomic_decrement( &pSeq->nRefCount ) == 0)
{
if (nElements > 0)
{
@@ -926,7 +926,7 @@ sal_Bool SAL_CALL uno_type_sequence_reference2One(
if (ret)
{
// easy destruction of empty sequence:
- if (osl_decrementInterlockedCount( &pSequence->nRefCount ) == 0)
+ if (osl_atomic_decrement( &pSequence->nRefCount ) == 0)
rtl_freeMemory( pSequence );
*ppSequence = pNew;
}
@@ -969,7 +969,7 @@ sal_Bool SAL_CALL uno_sequence_reference2One(
if (ret)
{
// easy destruction of empty sequence:
- if (osl_decrementInterlockedCount( &pSequence->nRefCount ) == 0)
+ if (osl_atomic_decrement( &pSequence->nRefCount ) == 0)
rtl_freeMemory( pSequence );
*ppSequence = pNew;
}
@@ -989,7 +989,7 @@ void SAL_CALL uno_sequence_assign(
{
if (*ppDest != pSource)
{
- ::osl_incrementInterlockedCount( &pSource->nRefCount );
+ osl_atomic_increment( &pSource->nRefCount );
idestructSequence( *ppDest, pTypeDescr->pWeakRef, pTypeDescr, release );
*ppDest = pSource;
}
@@ -1005,7 +1005,7 @@ void SAL_CALL uno_type_sequence_assign(
{
if (*ppDest != pSource)
{
- ::osl_incrementInterlockedCount( &pSource->nRefCount );
+ osl_atomic_increment( &pSource->nRefCount );
idestructSequence( *ppDest, pType, 0, release );
*ppDest = pSource;
}