diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-02-14 12:30:47 +0100 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-02-15 13:50:03 +0100 |
commit | a8a0e22edc53a58b293771ef793e9d6a0ac2f712 (patch) | |
tree | 59574b1629e7f478bcb694f750dc9ebc4c4fd827 /uui | |
parent | 5fba3d6ddef478b12bd15906682474400845a02b (diff) |
tdf#114676 release the SolarMutex, if we own it
This is a follow up on the SolarMutex unification. Quite probably
the updater process, which is now aborting when releasing the
not-owned mutex, should somewhere acquire it.
In the end this functions currently can be called with or without
the SolarMutex being owned by the calling thread.
This conditional release is really a horrible hack / workaround;
but my guess is - like all hacks - it'll stay for longer.
Change-Id: I90e30149c2fef8bdf3dc0396bf8eb7491eedeabd
Reviewed-on: https://gerrit.libreoffice.org/49717
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
(cherry picked from commit 0e04523b040785e2ce552143d20adcbb40b61d42)
Reviewed-on: https://gerrit.libreoffice.org/49795
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'uui')
-rw-r--r-- | uui/source/iahndl.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/uui/source/iahndl.cxx b/uui/source/iahndl.cxx index e2ce02c659d5..67f28e089e51 100644 --- a/uui/source/iahndl.cxx +++ b/uui/source/iahndl.cxx @@ -172,7 +172,11 @@ UUIInteractionHelper::handleRequest( HandleData aHD(rRequest); Link<void*,void> aLink(&aHD,handlerequest); Application::PostUserEvent(aLink,this); + comphelper::SolarMutex& rSolarMutex = Application::GetSolarMutex(); + sal_uInt32 nLockCount = (rSolarMutex.IsCurrentThread()) ? rSolarMutex.release(true) : 0; aHD.wait(); + if (nLockCount) + rSolarMutex.acquire(nLockCount); return aHD.bHandled; } else @@ -223,7 +227,11 @@ UUIInteractionHelper::getStringFromRequest( HandleData aHD(rRequest); Link<void*,void> aLink(&aHD,getstringfromrequest); Application::PostUserEvent(aLink,this); + comphelper::SolarMutex& rSolarMutex = Application::GetSolarMutex(); + sal_uInt32 nLockCount = (rSolarMutex.IsCurrentThread()) ? rSolarMutex.release(true) : 0; aHD.wait(); + if (nLockCount) + rSolarMutex.acquire(nLockCount); return aHD.m_aResult; } else |