[Libreoffice-commits] .: Branch 'libreoffice-3-3-2' - sal/osl

Bjoern Michaelsen bmichaelsen at kemper.freedesktop.org
Mon Mar 14 11:12:30 PDT 2011


 sal/osl/unx/interlck.c |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit 2199a47a3fdb624c93d222de9b72bef8edee6993
Author: Jani Monoses <jani.monoses at canonical.com>
Date:   Mon Mar 14 19:10:04 2011 +0100

    prefer gcc __sync functions over pthread
    
    Signed-off-by: Bjoern Michaelsen <bjoern.michaelsen at canonical.com>

diff --git a/sal/osl/unx/interlck.c b/sal/osl/unx/interlck.c
index f164371..184cb5f 100644
--- a/sal/osl/unx/interlck.c
+++ b/sal/osl/unx/interlck.c
@@ -134,7 +134,16 @@ oslInterlockedCount SAL_CALL osl_decrementInterlockedCount(oslInterlockedCount*
 
     return nCount;
 }
+#elif ( __GNUC__ > 4 ) || (( __GNUC__ == 4) && ( __GNUC_MINOR__ >= 4 ))
+oslInterlockedCount SAL_CALL osl_incrementInterlockedCount(oslInterlockedCount* pCount)
+{
+    return __sync_add_and_fetch(pCount, 1);
+}
 
+oslInterlockedCount SAL_CALL osl_decrementInterlockedCount(oslInterlockedCount* pCount)
+{
+    return __sync_sub_and_fetch(pCount, 1);
+}
 #else
 /* use only if nothing else works, expensive due to single mutex for all reference counts */
 


More information about the Libreoffice-commits mailing list