summaryrefslogtreecommitdiff
path: root/sal
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 /sal
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 'sal')
-rw-r--r--sal/inc/rtl/unload.h2
-rw-r--r--sal/osl/all/debugbase.cxx4
-rw-r--r--sal/osl/unx/pipe.c4
-rw-r--r--sal/osl/unx/socket.c4
-rw-r--r--sal/osl/w32/pipe.c8
-rw-r--r--sal/osl/w32/socket.cxx4
-rw-r--r--sal/osl/w32/thread.c2
-rw-r--r--sal/rtl/source/byteseq.cxx8
-rw-r--r--sal/rtl/source/unload.cxx4
9 files changed, 20 insertions, 20 deletions
diff --git a/sal/inc/rtl/unload.h b/sal/inc/rtl/unload.h
index cdd5536e6bc9..825d7778e5d1 100644
--- a/sal/inc/rtl/unload.h
+++ b/sal/inc/rtl/unload.h
@@ -263,7 +263,7 @@ access to a counter variable, e.g. the <code>rtl_moduleCount_release</code> impl
extern "C" void rtl_moduleCount_acquire(rtl_ModuleCount * that )
{
rtl_StandardModuleCount* pMod= (rtl_StandardModuleCount*)that;
- osl_incrementInterlockedCount( &pMod->counter);
+ osl_atomic_increment( &pMod->counter);
}
</pre>
The SAL library offers functions that can be used for <code>acquire</code> and <code>release</code>. See struct
diff --git a/sal/osl/all/debugbase.cxx b/sal/osl/all/debugbase.cxx
index 6648d53bf4e2..3b468fa821c0 100644
--- a/sal/osl/all/debugbase.cxx
+++ b/sal/osl/all/debugbase.cxx
@@ -155,7 +155,7 @@ void SAL_CALL osl_detail_ObjectRegistry_registerObject(
static_cast<void>(insertion);
}
else {
- osl_incrementInterlockedCount(&rData.m_nCount);
+ osl_atomic_increment(&rData.m_nCount);
}
}
@@ -170,7 +170,7 @@ void SAL_CALL osl_detail_ObjectRegistry_revokeObject(
static_cast<void>(n);
}
else {
- osl_decrementInterlockedCount(&rData.m_nCount);
+ osl_atomic_decrement(&rData.m_nCount);
}
}
diff --git a/sal/osl/unx/pipe.c b/sal/osl/unx/pipe.c
index 518559058f27..2758ece8ca03 100644
--- a/sal/osl/unx/pipe.c
+++ b/sal/osl/unx/pipe.c
@@ -354,7 +354,7 @@ oslPipe SAL_CALL osl_psz_createPipe(const sal_Char *pszPipeName, oslPipeOptions
void SAL_CALL osl_acquirePipe( oslPipe pPipe )
{
- osl_incrementInterlockedCount( &(pPipe->m_nRefCount) );
+ osl_atomic_increment( &(pPipe->m_nRefCount) );
}
void SAL_CALL osl_releasePipe( oslPipe pPipe )
@@ -363,7 +363,7 @@ void SAL_CALL osl_releasePipe( oslPipe pPipe )
if( 0 == pPipe )
return;
- if( 0 == osl_decrementInterlockedCount( &(pPipe->m_nRefCount) ) )
+ if( 0 == osl_atomic_decrement( &(pPipe->m_nRefCount) ) )
{
if( ! pPipe->m_bClosed )
osl_closePipe( pPipe );
diff --git a/sal/osl/unx/socket.c b/sal/osl/unx/socket.c
index d47146323df1..6d5e448082f7 100644
--- a/sal/osl/unx/socket.c
+++ b/sal/osl/unx/socket.c
@@ -1488,12 +1488,12 @@ oslSocket SAL_CALL osl_createSocket(oslAddrFamily Family,
void SAL_CALL osl_acquireSocket(oslSocket pSocket)
{
- osl_incrementInterlockedCount( &(pSocket->m_nRefCount ) );
+ osl_atomic_increment( &(pSocket->m_nRefCount ) );
}
void SAL_CALL osl_releaseSocket( oslSocket pSocket )
{
- if( pSocket && 0 == osl_decrementInterlockedCount( &(pSocket->m_nRefCount) ) )
+ if( pSocket && 0 == osl_atomic_decrement( &(pSocket->m_nRefCount) ) )
{
#if defined(LINUX)
if ( pSocket->m_bIsAccepting == sal_True )
diff --git a/sal/osl/w32/pipe.c b/sal/osl/w32/pipe.c
index e02692362028..3a9f11026e76 100644
--- a/sal/osl/w32/pipe.c
+++ b/sal/osl/w32/pipe.c
@@ -175,7 +175,7 @@ oslPipe SAL_CALL osl_createPipe(rtl_uString *strPipeName, oslPipeOptions Options
/* alloc memory */
pPipe= __osl_createPipeImpl();
- osl_incrementInterlockedCount(&(pPipe->m_Reference));
+ osl_atomic_increment(&(pPipe->m_Reference));
/* build system pipe name */
rtl_uString_assign(&temp, path);
@@ -266,7 +266,7 @@ oslPipe SAL_CALL osl_createPipe(rtl_uString *strPipeName, oslPipeOptions Options
void SAL_CALL osl_acquirePipe( oslPipe pPipe )
{
- osl_incrementInterlockedCount( &(pPipe->m_Reference) );
+ osl_atomic_increment( &(pPipe->m_Reference) );
}
void SAL_CALL osl_releasePipe( oslPipe pPipe )
@@ -276,7 +276,7 @@ void SAL_CALL osl_releasePipe( oslPipe pPipe )
if( 0 == pPipe )
return;
- if( 0 == osl_decrementInterlockedCount( &(pPipe->m_Reference) ) )
+ if( 0 == osl_atomic_decrement( &(pPipe->m_Reference) ) )
{
if( ! pPipe->m_bClosed )
osl_closePipe( pPipe );
@@ -357,7 +357,7 @@ oslPipe SAL_CALL osl_acceptPipe(oslPipe pPipe)
pAcceptedPipe = __osl_createPipeImpl();
OSL_ASSERT(pAcceptedPipe);
- osl_incrementInterlockedCount(&(pAcceptedPipe->m_Reference));
+ osl_atomic_increment(&(pAcceptedPipe->m_Reference));
rtl_uString_assign(&pAcceptedPipe->m_Name, pPipe->m_Name);
pAcceptedPipe->m_File = pPipe->m_File;
diff --git a/sal/osl/w32/socket.cxx b/sal/osl/w32/socket.cxx
index 4f150d0e6486..42a0e37a8212 100644
--- a/sal/osl/w32/socket.cxx
+++ b/sal/osl/w32/socket.cxx
@@ -1144,12 +1144,12 @@ oslSocket SAL_CALL osl_createSocket (
void SAL_CALL osl_acquireSocket( oslSocket pSocket )
{
- osl_incrementInterlockedCount( &(pSocket->m_nRefCount) );
+ osl_atomic_increment( &(pSocket->m_nRefCount) );
}
void SAL_CALL osl_releaseSocket( oslSocket pSocket )
{
- if( pSocket && 0 == osl_decrementInterlockedCount( &(pSocket->m_nRefCount) ) )
+ if( pSocket && 0 == osl_atomic_decrement( &(pSocket->m_nRefCount) ) )
{
osl_closeSocket( pSocket );
__osl_destroySocketImpl( pSocket );
diff --git a/sal/osl/w32/thread.c b/sal/osl/w32/thread.c
index 78260d66ae42..5281ace5a2f8 100644
--- a/sal/osl/w32/thread.c
+++ b/sal/osl/w32/thread.c
@@ -355,7 +355,7 @@ void SAL_CALL osl_terminateThread(oslThread Thread)
return;
}
- osl_incrementInterlockedCount(&(pThreadImpl->m_nTerminationRequested));
+ osl_atomic_increment(&(pThreadImpl->m_nTerminationRequested));
}
diff --git a/sal/rtl/source/byteseq.cxx b/sal/rtl/source/byteseq.cxx
index 432483c1e3f5..ee745818f0a8 100644
--- a/sal/rtl/source/byteseq.cxx
+++ b/sal/rtl/source/byteseq.cxx
@@ -65,7 +65,7 @@ void SAL_CALL rtl_byte_sequence_reference2One(
if ( pNew != 0 )
memcpy( pNew->elements, pSequence->elements, nElements );
- if (! osl_decrementInterlockedCount( &pSequence->nRefCount ))
+ if (! osl_atomic_decrement( &pSequence->nRefCount ))
rtl_freeMemory( pSequence );
}
else
@@ -114,7 +114,7 @@ void SAL_CALL rtl_byte_sequence_realloc(
}
}
- if (! osl_decrementInterlockedCount( &pSequence->nRefCount ))
+ if (! osl_atomic_decrement( &pSequence->nRefCount ))
rtl_freeMemory( pSequence );
pSequence = pNew;
}
@@ -138,7 +138,7 @@ void SAL_CALL rtl_byte_sequence_acquire( sal_Sequence *pSequence )
SAL_THROW_EXTERN_C()
{
OSL_ASSERT( pSequence );
- osl_incrementInterlockedCount( &(pSequence->nRefCount) );
+ osl_atomic_increment( &(pSequence->nRefCount) );
}
//==================================================================================================
@@ -147,7 +147,7 @@ void SAL_CALL rtl_byte_sequence_release( sal_Sequence *pSequence )
{
if ( pSequence != 0 )
{
- if (! osl_decrementInterlockedCount( &(pSequence->nRefCount )) )
+ if (! osl_atomic_decrement( &(pSequence->nRefCount )) )
{
rtl_freeMemory( pSequence );
}
diff --git a/sal/rtl/source/unload.cxx b/sal/rtl/source/unload.cxx
index 5e9cdf1e0482..beb9e11f25fd 100644
--- a/sal/rtl/source/unload.cxx
+++ b/sal/rtl/source/unload.cxx
@@ -130,7 +130,7 @@ extern "C" void rtl_moduleCount_acquire(rtl_ModuleCount * that )
(void) that;
#else
rtl_StandardModuleCount* pMod= (rtl_StandardModuleCount*)that;
- osl_incrementInterlockedCount( &pMod->counter);
+ osl_atomic_increment( &pMod->counter);
#endif
}
@@ -141,7 +141,7 @@ extern "C" void rtl_moduleCount_release( rtl_ModuleCount * that )
#else
rtl_StandardModuleCount* pMod= (rtl_StandardModuleCount*)that;
OSL_ENSURE( pMod->counter >0 , "library counter incorrect" );
- osl_decrementInterlockedCount( &pMod->counter);
+ osl_atomic_decrement( &pMod->counter);
if( pMod->counter == 0)
{
MutexGuard guard( getUnloadingMutex());