Kaydet (Commit) bded890a authored tarafından Jan-Marek Glogowski's avatar Jan-Marek Glogowski

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: 's avatarKatarina Behrens <Katarina.Behrens@cib.de>
Reviewed-by: 's avatarJan-Marek Glogowski <glogow@fbihome.de>
üst deafd385
......@@ -140,6 +140,7 @@ std::shared_ptr<SalBitmap> 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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment