vcl/headless/svpinst.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
New commits: commit b9ea3467383ccdfe4be842e61267256f281487ee Author: Jan-Marek Glogowski <glo...@fbihome.de> AuthorDate: Fri Jun 18 14:42:20 2021 +0200 Commit: Jan-Marek Glogowski <glo...@fbihome.de> CommitDate: Tue Jun 22 12:28:48 2021 +0200 svp: always release SolarMutex on yield Always give other threads a chance to acquire the SolarMutex, if we yield. Change-Id: I77d93374ea606acd1f7820755197a27655418639 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117454 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.me...@collabora.com> Reviewed-by: Jan-Marek Glogowski <glo...@fbihome.de> diff --git a/vcl/headless/svpinst.cxx b/vcl/headless/svpinst.cxx index 700c6b87f645..36859e9b3fb2 100644 --- a/vcl/headless/svpinst.cxx +++ b/vcl/headless/svpinst.cxx @@ -490,7 +490,7 @@ bool SvpSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents) else nTimeoutMicroS = -1; // wait until something happens - sal_uInt32 nAcquireCount = ReleaseYieldMutexAll(); + SolarMutexReleaser aReleaser; if (pSVData->mpPollCallback) { @@ -523,11 +523,12 @@ bool SvpSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents) } // here no need to check m_Request because Acquire will do it } - AcquireYieldMutex( nAcquireCount ); } - else if (bSkipPoll) + else { - pMutex->m_NonMainWaitingYieldCond.set(); // wake up other threads + if (bSkipPoll) + pMutex->m_NonMainWaitingYieldCond.set(); // wake up other threads + SolarMutexReleaser aReleaser; } } else // !IsMainThread() @@ -544,9 +545,8 @@ bool SvpSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents) { // block & release YieldMutex until the main thread does something pMutex->m_NonMainWaitingYieldCond.reset(); - sal_uInt32 nAcquireCount = ReleaseYieldMutexAll(); + SolarMutexReleaser aReleaser; pMutex->m_NonMainWaitingYieldCond.wait(); - AcquireYieldMutex( nAcquireCount ); } } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits