[Libreoffice-commits] core.git: include/osl

Jan-Marek Glogowski (via logerrit) logerrit at kemper.freedesktop.org
Thu Apr 11 21:54:24 UTC 2019


 include/osl/mutex.hxx |   19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

New commits:
commit ad7302b5a62bbf382fb7e900cedfa317a4bf57d8
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Wed Apr 10 17:38:10 2019 +0200
Commit:     Thorsten Behrens <Thorsten.Behrens at CIB.de>
CommitDate: Thu Apr 11 23:53:48 2019 +0200

    [API CHANGE] Restore old exteral API behaviour
    
    Commit d38f9934f08939032cca64a32de58fa3901a88d5 ("[API CHANGE]
    Asserts to never clear already cleared guard") changes the API
    in a way, which can silently break compiling code for no reason.
    
    As discussed on the mailing list, this uses LIBO_INTERNAL_ONLY to
    restores the old behaviour for external API users.
    
    Change-Id: I43c9b955c1c8f5402588fcea2bfc38ab6fa9f263
    Reviewed-on: https://gerrit.libreoffice.org/70528
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
    Tested-by: Jenkins

diff --git a/include/osl/mutex.hxx b/include/osl/mutex.hxx
index 9a9f76f67efa..f984f035ca40 100644
--- a/include/osl/mutex.hxx
+++ b/include/osl/mutex.hxx
@@ -185,9 +185,15 @@ namespace osl
         */
         void clear()
         {
+#ifdef LIBO_INTERNAL_ONLY
             assert(pT);
-            pT->release();
-            pT = NULL;
+#else
+            if (pT)
+#endif
+            {
+                pT->release();
+                pT = NULL;
+            }
         }
     };
 
@@ -226,9 +232,14 @@ namespace osl
         */
         void reset()
         {
+#ifdef LIBO_INTERNAL_ONLY
             assert(!this->pT);
-            this->pT = pResetT;
-            this->pT->acquire();
+#endif
+            if (pResetT)
+            {
+                this->pT = pResetT;
+                this->pT->acquire();
+            }
         }
     };
 


More information about the Libreoffice-commits mailing list