diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2021-06-25 09:55:20 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2021-11-30 20:39:33 +0100 |
commit | 5fbc7ab55a119504fc484cef28de52b6d5cf8b12 (patch) | |
tree | bfd54afc1de2e42dc39d1b7453a0a2fdaa1f97dd /libreofficekit/source | |
parent | 2a323bbbfa8c64bd6f8c30922f11e16a4d85756c (diff) |
svp: normalize DoYield
I somehow missed / forgot, that SvpInstance::DoYield was now also
yielding on the main thread and doesn't try to do "funky" multi-
threaded event processing anymore (because it's no GUI), since
commit 0efd06de8fca4036c4132b2745a11273b1755df2 ("vcl: fix hangs
in SvpSalInstance"),
So this just moves the main thread part into ImplYield and
implements DoYield like on all other architectures, as described
in README.scheduler.
I've tried to fix the LOK poll to be more sensible.
Change-Id: I4323685aa250e9d62a2f448cef358a7aa8ae862c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117899
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'libreofficekit/source')
-rw-r--r-- | libreofficekit/source/gtk/lokdocview.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx index 015995016a36..2d7852f3781e 100644 --- a/libreofficekit/source/gtk/lokdocview.cxx +++ b/libreofficekit/source/gtk/lokdocview.cxx @@ -2729,16 +2729,17 @@ static gboolean timeout_wakeup(void *) // integrate our mainloop with LOK's static int lok_poll_callback(void*, int timeoutUs) { - if (timeoutUs) + bool bWasEvent(false); + if (timeoutUs > 0) { guint timeout = g_timeout_add(timeoutUs / 1000, timeout_wakeup, nullptr); - g_main_context_iteration(nullptr, true); + bWasEvent = g_main_context_iteration(nullptr, true); g_source_remove(timeout); } else - g_main_context_iteration(nullptr, FALSE); + bWasEvent = g_main_context_iteration(nullptr, timeoutUs < 0); - return 0; + return bWasEvent ? 1 : 0; } // thread-safe wakeup of our mainloop |