From f14f738a627b5a6f6c1242f4fe123e4cc9e9c811 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 16 Feb 2017 15:04:43 +0000 Subject: dix/os: Merge priority computation into SmartScheduleClient Backported from X.org: commit 7762a602c1dfdd8cfcf2b8c2281cf4d683d05216 Author: Keith Packard Date: Thu May 19 15:05:55 2016 -0700 dix/os: Merge priority computation into SmartScheduleClient Instead of having scheduling done in two places (one in WaitForSomething, and the other in SmartScheduleClient), just stick all of the scheduling in SmartScheduleClient. Signed-off-by: Keith Packard Reviewed-by: Adam Jackson Backported-to-NX-by: Mike Gabriel --- nx-X11/programs/Xserver/os/WaitFor.c | 41 ++++-------------------------------- 1 file changed, 4 insertions(+), 37 deletions(-) (limited to 'nx-X11/programs/Xserver/os') diff --git a/nx-X11/programs/Xserver/os/WaitFor.c b/nx-X11/programs/Xserver/os/WaitFor.c index 3ac2e1c7e..02c460f0c 100644 --- a/nx-X11/programs/Xserver/os/WaitFor.c +++ b/nx-X11/programs/Xserver/os/WaitFor.c @@ -544,17 +544,14 @@ WaitForSomething(int *pClientsReady) #ifndef WIN32 for (i=0; ipriority; - if (nready == 0 || client_priority > highest_priority) - { - /* Either we found the first client, or we found - * a client whose priority is greater than all others - * that have been found so far. Either way, we want - * to initialize the list of clients to contain just - * this client. - */ - pClientsReady[0] = client_index; - highest_priority = client_priority; - nready = 1; - } - /* the following if makes sure that multiple same-priority - * clients get batched together - */ - else if (client_priority == highest_priority) -#endif - { - pClientsReady[nready++] = client_index; - } + pClientsReady[nready++] = client_index; #ifndef WIN32 - clientsReadable.fds_bits[i] &= ~(((fd_mask)1L) << curclient); - } + clientsReadable.fds_bits[i] &= ~(((fd_mask)1L) << curclient); + } #else FD_CLR(curclient, &clientsReadable); #endif -- cgit v1.2.3