summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2018-07-20 16:04:48 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2018-07-23 12:40:06 +0200
commitbb035edcadf0d7e77e45b421ac6c06c1f3183465 (patch)
treefc6995dbdfaaf394af1157aacfeb3d096210fdaa /vcl
parent2bceb245e60be2cf973c7b9d586b74881f66fbef (diff)
Avoid deadlock in case of events not driven by the user
e.g. progress bar updates. Release and re-acquire SolarMutex Change-Id: Ie4e12fed7b2b8ee9bcb163334d82e466025cb7fa Reviewed-on: https://gerrit.libreoffice.org/57780 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/qt5/Qt5Instance.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx
index fc06d47d317b..cf45dacf835a 100644
--- a/vcl/qt5/Qt5Instance.cxx
+++ b/vcl/qt5/Qt5Instance.cxx
@@ -140,6 +140,7 @@ std::shared_ptr<SalBitmap> Qt5Instance::CreateSalBitmap()
bool Qt5Instance::ImplYield(bool bWait, bool bHandleAllCurrentEvents)
{
+ SolarMutexGuard aGuard;
bool wasEvent = DispatchUserEvents(bHandleAllCurrentEvents);
if (!bHandleAllCurrentEvents && wasEvent)
return true;
@@ -161,6 +162,8 @@ bool Qt5Instance::DoYield(bool bWait, bool bHandleAllCurrentEvents)
bool bWasEvent = false;
if (qApp->thread() == QThread::currentThread())
{
+ // release YieldMutex (and re-acquire in ImplYield)
+ SolarMutexReleaser aReleaser;
bWasEvent = ImplYield(bWait, bHandleAllCurrentEvents);
if (bWasEvent)
m_aWaitingYieldCond.set();