aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-01-15 15:48:49 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2021-01-15 15:48:49 +0100
commitd545afdf3967b0305c1215bb9f8a545b81fc24e8 (patch)
treeca88f81d6a01fc6198a3960a3043cd05452adb96 /nx-X11/programs
parentd5a3b440130257e08f7e507eae711885b4f4db50 (diff)
parente7d5ba4e5a5394633dbd3ce5a3fd5314309bc641 (diff)
downloadnx-libs-d545afdf3967b0305c1215bb9f8a545b81fc24e8.tar.gz
nx-libs-d545afdf3967b0305c1215bb9f8a545b81fc24e8.tar.bz2
nx-libs-d545afdf3967b0305c1215bb9f8a545b81fc24e8.zip
Merge branch 'uli42-pr/fix_resume' into 3.6.x
Attributes GH PR #977: https://github.com/ArcticaProject/nx-libs/pull/977
Diffstat (limited to 'nx-X11/programs')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Handlers.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c
index 9f0a3c9d9..62974b9c1 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c
@@ -1070,7 +1070,28 @@ void nxagentDispatchHandler(ClientPtr client, int in, int out)
* into the inner dispatch loop forever.
*/
- if (!SmartScheduleSignalEnable)
+ /*
+ * The behaviour described in the comment above also happens with the
+ * smart scheduler if all of the following conditions are met:
+ * - the agent is suspended
+ * - SleepTimeMillis is set (the default is sufficient to trigger this)
+ * - a client is doing a lot of image operations
+ * - nxagentShadowCounter is 0
+ * In that case the agent will slow down the image operations by calling
+ * an intermediate sleep resulting in the client's request queue never
+ * being empty. Which in turn leads to the drain loop described above.
+ * isItTimeToYield will then never be set. The (dramatic) result of this
+ * is that nxagent will not process any signals and therefore cannot be
+ * resumed anymore!
+ * For this reason we do not limit below code to the dumb scheduler but also
+ * run it if above conditions are met - ensuring regular yields.
+ * See issue #903
+ */
+
+ if (!SmartScheduleSignalEnable ||
+ (nxagentShadowCounter == 0 &&
+ NXDisplayError(nxagentDisplay) == 1 &&
+ nxagentOption(SleepTimeMillis) > 0))
{
if (client -> index != nxagentDispatch.client)
{