xserver: Branch 'master'

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Feb 23 23:10:13 UTC 2024


 dix/dixutils.c       |    4 ++++
 doc/Xserver-spec.xml |    9 +++------
 os/WaitFor.c         |    4 +---
 os/osdep.h           |    2 --
 4 files changed, 8 insertions(+), 11 deletions(-)

New commits:
commit af9f70013abc4201c473da7485addc898da4d0da
Author: Enrico Weigelt, metux IT consult <info at metux.net>
Date:   Mon Feb 19 12:52:25 2024 +0100

    dix: dixutils: make workQueue pointer dix-private
    
    The workQueue pointer is currently declared extern, so that WaitForSomething()
    can check wether we've got something in the queue and call ProcessWorkQueue()
    then.
    
    But that's trivial to simplify: just let ProcessWorkQueue() return early if
    workQueue == NULL. Gives us a better isolation of internal stuff as well as
    ProcessWorkQueue() protecting itself from possible segfault.
    
    Signed-off-by: Enrico Weigelt, metux IT consult <info at metux.net>
    Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1310>

diff --git a/dix/dixutils.c b/dix/dixutils.c
index 331ccfb96..a11c82e9f 100644
--- a/dix/dixutils.c
+++ b/dix/dixutils.c
@@ -525,6 +525,10 @@ ProcessWorkQueue(void)
 {
     WorkQueuePtr q, *p;
 
+    // don't have a work queue yet
+    if (!workQueue)
+        return;
+
     p = &workQueue;
     /*
      * Scan the work queue once, calling each function.  Those
diff --git a/doc/Xserver-spec.xml b/doc/Xserver-spec.xml
index 15ecb0fd5..f33d90475 100644
--- a/doc/Xserver-spec.xml
+++ b/doc/Xserver-spec.xml
@@ -657,14 +657,11 @@ make the server suspend until one or more of the following occurs:
 <para>
 Before WaitForSomething() computes the masks to pass to select, poll or
 similar operating system interface, it needs to
-see if there is anything to do on the work queue; if so, it must call a DIX
-routine called ProcessWorkQueue.
+see if there is anything to do on the work queue; it must call a DIX
+routine called ProcessWorkQueue().
 <blockquote>
 <programlisting>
-	extern WorkQueuePtr	workQueue;
-
-	if (workQueue)
-		ProcessWorkQueue ();
+	ProcessWorkQueue ();
 </programlisting>
 </blockquote>
 </para>
diff --git a/os/WaitFor.c b/os/WaitFor.c
index ff1d376e9..1bb4ecc45 100644
--- a/os/WaitFor.c
+++ b/os/WaitFor.c
@@ -188,9 +188,7 @@ WaitForSomething(Bool are_ready)
        crashed connections and the screen saver timeout */
     while (1) {
         /* deal with any blocked jobs */
-        if (workQueue) {
-            ProcessWorkQueue();
-        }
+        ProcessWorkQueue();
 
         timeout = check_timers();
         are_ready = clients_are_ready();
diff --git a/os/osdep.h b/os/osdep.h
index 5b64f1a38..85fc7f9a1 100644
--- a/os/osdep.h
+++ b/os/osdep.h
@@ -123,8 +123,6 @@ listen_to_client(ClientPtr client);
 
 extern Bool NewOutputPending;
 
-extern WorkQueuePtr workQueue;
-
 /* in access.c */
 extern Bool ComputeLocalClient(ClientPtr client);
 


More information about the xorg-commit mailing list