xserver: Branch 'server-1.20-branch'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Mar 21 14:39:31 UTC 2019


 dix/dixutils.c |   13 +++++++++++++
 dix/main.c     |    2 ++
 include/dix.h  |    2 ++
 3 files changed, 17 insertions(+)

New commits:
commit 34553f502650641aec4f20ab43180804f17032c6
Author: Ray Strode <rstrode at redhat.com>
Date:   Fri Nov 16 14:36:55 2018 -0500

    dix: ensure work queues are cleared on reset
    
    If the server resets, most client workqueues are cleaned up as the
    clients are killed.
    
    The one exception is the server's client, which is exempt from
    the killing spree.
    
    If that client has a queued work procedure active, it won't get
    cleared on reset.
    
    This commit ensures it gets cleared too.
    
    (cherry picked from commit 8738ce85df535bdfdfecfce1c0d64e209cc6e508)
    
    Fixes: xorg/xserver#670

diff --git a/dix/dixutils.c b/dix/dixutils.c
index 540023cbd..2983174a1 100644
--- a/dix/dixutils.c
+++ b/dix/dixutils.c
@@ -508,6 +508,19 @@ WorkQueuePtr workQueue;
 static WorkQueuePtr *workQueueLast = &workQueue;
 
 void
+ClearWorkQueue(void)
+{
+    WorkQueuePtr q, *p;
+
+    p = &workQueue;
+    while ((q = *p)) {
+        *p = q->next;
+        free(q);
+    }
+    workQueueLast = p;
+}
+
+void
 ProcessWorkQueue(void)
 {
     WorkQueuePtr q, *p;
diff --git a/dix/main.c b/dix/main.c
index f98643aa5..b228d9c28 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -342,6 +342,8 @@ dix_main(int argc, char *argv[], char *envp[])
 
         DeleteCallbackManager();
 
+        ClearWorkQueue();
+
         if (dispatchException & DE_TERMINATE) {
             CloseWellKnownConnections();
         }
diff --git a/include/dix.h b/include/dix.h
index 476559842..b6e2bcfde 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -240,6 +240,8 @@ extern _X_EXPORT void RemoveBlockAndWakeupHandlers(ServerBlockHandlerProcPtr blo
 
 extern _X_EXPORT void InitBlockAndWakeupHandlers(void);
 
+extern _X_EXPORT void ClearWorkQueue(void);
+
 extern _X_EXPORT void ProcessWorkQueue(void);
 
 extern _X_EXPORT void ProcessWorkQueueZombies(void);


More information about the xorg-commit mailing list