dix: Use list for ready clients

This converts the dispatch loop into using a list of ready clients
instead of an array. This changes the WaitForSomething API so that it
notifies DIX when a client becomes ready to read, instead of returning
the set of ready clients.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Keith Packard 2016-05-19 13:59:54 -07:00 • committed by Adam Jackson
commit 8f1edf4bd3
6 changed files with 118 additions and 55 deletions

View file

@ -1232,6 +1232,7 @@ IgnoreClient(ClientPtr client)
return;
isItTimeToYield = TRUE;
mark_client_not_ready(client);
if (!GrabInProgress || FD_ISSET(connection, &AllClients)) {
if (FD_ISSET(connection, &ClientsWithInput))
FD_SET(connection, &IgnoredClientsWithInput);
@ -1273,8 +1274,10 @@ AttendClient(ClientPtr client)
FD_SET(connection, &AllClients);
FD_SET(connection, &AllSockets);
FD_SET(connection, &LastSelectMask);
if (FD_ISSET(connection, &IgnoredClientsWithInput))
if (FD_ISSET(connection, &IgnoredClientsWithInput)) {
FD_SET(connection, &ClientsWithInput);
mark_client_ready(client);
}
}
else {
FD_SET(connection, &SavedAllClients);