xserver: Branch 'master' - 2 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Nov 13 15:38:05 UTC 2018


 os/connection.c |   29 +++++++++++------------------
 xkb/xkbInit.c   |    4 ++--
 2 files changed, 13 insertions(+), 20 deletions(-)

New commits:
commit 23752b3ef889ada7b705c51f478f5817e5caaed3
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Oct 25 13:13:13 2018 -0400

    os: Establish new connections synchronously not on the work queue
    
    This contortion made a bit more sense before we got SetNotifyFd and
    friends, but now there's no need for it.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/os/connection.c b/os/connection.c
index de9696ec8..fd4f9c0ed 100644
--- a/os/connection.c
+++ b/os/connection.c
@@ -133,7 +133,7 @@ static Pid_t ParentProcess;
 int GrabInProgress = 0;
 
 static void
-QueueNewConnections(int curconn, int ready, void *data);
+EstablishNewConnections(int curconn, int ready, void *data);
 
 static void
 set_poll_client(ClientPtr client);
@@ -270,7 +270,7 @@ CreateWellKnownSockets(void)
         int fd = _XSERVTransGetConnectionNumber(ListenTransConns[i]);
 
         ListenTransFds[i] = fd;
-        SetNotifyFd(fd, QueueNewConnections, X_NOTIFY_READ, NULL);
+        SetNotifyFd(fd, EstablishNewConnections, X_NOTIFY_READ, NULL);
 
         if (!_XSERVTransIsLocal(ListenTransConns[i]))
             DefineSelf (fd);
@@ -330,7 +330,8 @@ ResetWellKnownSockets(void)
         }
     }
     for (i = 0; i < ListenTransCount; i++)
-        SetNotifyFd(ListenTransFds[i], QueueNewConnections, X_NOTIFY_READ, NULL);
+        SetNotifyFd(ListenTransFds[i], EstablishNewConnections, X_NOTIFY_READ,
+                    NULL);
 
     ResetAuthorization();
     ResetHosts(display);
@@ -638,14 +639,12 @@ AllocNewConnection(XtransConnInfo trans_conn, int fd, CARD32 conn_time)
 /*****************
  * EstablishNewConnections
  *    If anyone is waiting on listened sockets, accept them.
- *    Returns a mask with indices of new clients.  Updates AllClients
- *    and AllSockets.
+ *    Updates AllClients and AllSockets.
  *****************/
 
-static Bool
-EstablishNewConnections(ClientPtr clientUnused, void *closure)
+static void
+EstablishNewConnections(int curconn, int ready, void *data)
 {
-    int curconn = (int) (intptr_t) closure;
     int newconn;       /* fd of new client */
     CARD32 connect_time;
     int i;
@@ -667,10 +666,10 @@ EstablishNewConnections(ClientPtr clientUnused, void *closure)
     }
 
     if ((trans_conn = lookup_trans_conn(curconn)) == NULL)
-        return TRUE;
+        return;
 
     if ((new_trans_conn = _XSERVTransAccept(trans_conn, &status)) == NULL)
-        return TRUE;
+        return;
 
     newconn = _XSERVTransGetConnectionNumber(new_trans_conn);
 
@@ -682,13 +681,7 @@ EstablishNewConnections(ClientPtr clientUnused, void *closure)
     if (!AllocNewConnection(new_trans_conn, newconn, connect_time)) {
         ErrorConnMax(new_trans_conn);
     }
-    return TRUE;
-}
-
-static void
-QueueNewConnections(int fd, int ready, void *data)
-{
-    QueueWorkProc(EstablishNewConnections, NULL, (void *) (intptr_t) fd);
+    return;
 }
 
 #define NOROOM "Maximum number of clients reached"
@@ -1015,7 +1008,7 @@ ListenOnOpenFD(int fd, int noxauth)
     ListenTransConns[ListenTransCount] = ciptr;
     ListenTransFds[ListenTransCount] = fd;
 
-    SetNotifyFd(fd, QueueNewConnections, X_NOTIFY_READ, NULL);
+    SetNotifyFd(fd, EstablishNewConnections, X_NOTIFY_READ, NULL);
 
     /* Increment the count */
     ListenTransCount++;
commit 69d8ea4a49793a94f821d1a328856901a1c02a5a
Author: Adam Jackson <ajax at redhat.com>
Date:   Thu Oct 25 11:22:19 2018 -0400

    xkb: Write the _XKB_RULES_NAMES window property synchronously
    
    I can't think of a good reason why this would need to be deferred to the
    work queue. When we get to this point we're never in the middle of
    request processing, so we can't corrupt the event/reply stream.
    
    Signed-off-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/xkb/xkbInit.c b/xkb/xkbInit.c
index 9e45b4b71..4108e1b26 100644
--- a/xkb/xkbInit.c
+++ b/xkb/xkbInit.c
@@ -142,7 +142,7 @@ XkbFreeRMLVOSet(XkbRMLVOSet * rmlvo, Bool freeRMLVO)
 }
 
 static Bool
-XkbWriteRulesProp(ClientPtr client, void *closure)
+XkbWriteRulesProp(void)
 {
     int len, out;
     Atom name;
@@ -235,7 +235,7 @@ XkbSetRulesUsed(XkbRMLVOSet * rmlvo)
     free(XkbOptionsUsed);
     XkbOptionsUsed = (rmlvo->options ? Xstrdup(rmlvo->options) : NULL);
     if (XkbWantRulesProp)
-        QueueWorkProc(XkbWriteRulesProp, NULL, NULL);
+        XkbWriteRulesProp();
     return;
 }
 


More information about the xorg-commit mailing list