summaryrefslogtreecommitdiff
path: root/cppu/source/helper
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/source/helper
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/source/helper')
-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
3 files changed, 7 insertions, 7 deletions
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)