From bded890a44cc3cc7ce07113565ce80469697f73f Mon Sep 17 00:00:00 2001 From: Jan-Marek Glogowski Date: Mon, 23 Jul 2018 11:58:07 +0000 Subject: Qt5 just release the SolarMutex for Qt events Just like the other backends, just release the SolarMutex when processing Qt events and keep it for user events. Change-Id: I0c4a7149f1541607b546a99e51e790836bc9b2f9 Reviewed-on: https://gerrit.libreoffice.org/57844 Tested-by: Jenkins Reviewed-by: Katarina Behrens Reviewed-by: Jan-Marek Glogowski --- vcl/qt5/Qt5Instance.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'vcl') diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx index cf45dacf835a..c365afbe8ec2 100644 --- a/vcl/qt5/Qt5Instance.cxx +++ b/vcl/qt5/Qt5Instance.cxx @@ -140,6 +140,7 @@ std::shared_ptr Qt5Instance::CreateSalBitmap() bool Qt5Instance::ImplYield(bool bWait, bool bHandleAllCurrentEvents) { + // Re-aquire the guard for user events when called via Q_EMIT ImplYieldSignal SolarMutexGuard aGuard; bool wasEvent = DispatchUserEvents(bHandleAllCurrentEvents); if (!bHandleAllCurrentEvents && wasEvent) @@ -149,6 +150,7 @@ bool Qt5Instance::ImplYield(bool bWait, bool bHandleAllCurrentEvents) * Quoting the Qt docs: [QAbstractEventDispatcher::processEvents] processes * pending events that match flags until there are no more events to process. */ + SolarMutexReleaser aReleaser; QAbstractEventDispatcher* dispatcher = QAbstractEventDispatcher::instance(qApp->thread()); if (bWait && !wasEvent) wasEvent = dispatcher->processEvents(QEventLoop::WaitForMoreEvents); @@ -162,8 +164,6 @@ 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(); -- cgit