diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-02-14 12:30:47 +0100 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-02-14 17:34:27 +0100 |
commit | 0e04523b040785e2ce552143d20adcbb40b61d42 (patch) | |
tree | 49de5d764ca8a66253ce7383f1506538a444735b /uui/source | |
parent | 20c881bf89048ad19c1d108f7e89d1b9d94f5aba (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>
Diffstat (limited to 'uui/source')
-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 f03372de3f54..59f62217c6ac 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 |