summaryrefslogtreecommitdiff
path: root/include/osl
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2019-04-10 17:38:10 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2019-04-11 23:53:48 +0200
commitad7302b5a62bbf382fb7e900cedfa317a4bf57d8 (patch)
treeada517989eec8fb03ec9d5b8a1b71cd46dba9526 /include/osl
parent5dfc4fd2af11322dfbface30fd66c1ce553a0703 (diff)
[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@redhat.com> Tested-by: Jenkins
Diffstat (limited to 'include/osl')
-rw-r--r--include/osl/mutex.hxx19
1 files changed, 15 insertions, 4 deletions
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();
+ }
}
};