vcl/unx/gtk/gtkinst.cxx | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-)
New commits: commit 22f5afb78aeaf6e5e9a4fb00d74833d73cef5bbc Author: Jan-Marek Glogowski <glo...@fbihome.de> AuthorDate: Sat Mar 23 00:44:50 2019 +0100 Commit: Jan-Marek Glogowski <glo...@fbihome.de> CommitDate: Fri Mar 29 03:01:30 2019 +0100 GTK use SalYieldMutex lock arguments The acquire and release functions already provide arguments to release and re-acquire the lock, so use these. Also moves the n-1 lock handling from release into acquire. This way release doesn't need any special handling, which acquire already does. Change-Id: If2fc92beb8e3ea1f5c078da4d8dde3ce9c774c6f Reviewed-on: https://gerrit.libreoffice.org/69574 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glo...@fbihome.de> diff --git a/vcl/unx/gtk/gtkinst.cxx b/vcl/unx/gtk/gtkinst.cxx index 64604ea3f92a..f18dc9457fd5 100644 --- a/vcl/unx/gtk/gtkinst.cxx +++ b/vcl/unx/gtk/gtkinst.cxx @@ -313,20 +313,18 @@ void GtkYieldMutex::ThreadsEnter() if (!yieldCounts.empty()) { auto n = yieldCounts.top(); yieldCounts.pop(); - for (; n != 0; --n) { - acquire(); - } + assert(n > 0); + n--; + if (n > 0) + acquire(n); } } void GtkYieldMutex::ThreadsLeave() { assert(m_nCount != 0); - auto n = m_nCount - 1; - yieldCounts.push(n); - for (sal_uIntPtr i = 0; i != n + 1; ++i) { - release(); - } + yieldCounts.push(m_nCount); + release(true); } std::unique_ptr<SalVirtualDevice> GtkInstance::CreateVirtualDevice( SalGraphics *pG, _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits