Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Hi all,

please review the attached patch which applies an important and safe
subset of the changes to sal/osl/unx/interlck.c on master to 3.3.2,
mostly:

 http://cgit.freedesktop.org/libreoffice/ure/commit/?id=788072cefdce8cb61d46549a7aede4c754d9fae3

So the commit should have "Jani Monoses <jani.monoses@canonical.com>"
as author.

Best Regards,

Bjoern

-- 
https://launchpad.net/~bjoern-michaelsen
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 */
 

Attachment: signature.asc
Description: PGP signature


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.