diff options
author | Keith Packard <keithp@keithp.com> | 2016-05-26 10:40:44 -0700 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2016-07-21 15:04:47 -0400 |
commit | f993091e7db81b0420e23c485378cba112278839 (patch) | |
tree | 1fa9dc096853f7a8c512f76e4d7f57c8a132e598 /include | |
parent | 8f1edf4bd3a1f050ce9eeb5eac45dd1a8f7a6d5e (diff) |
os: Switch server to poll(2) [v3]
Eliminates all of the fd_set mangling in the server main thread
v2: Listen for POLLOUT while writes are blocked.
v3: Only mark client not ready on EAGAIN return from read
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/dixstruct.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/dixstruct.h b/include/dixstruct.h index 1f383497c..3b578f81a 100644 --- a/include/dixstruct.h +++ b/include/dixstruct.h @@ -77,6 +77,7 @@ typedef struct _Client { void *requestBuffer; void *osPrivate; /* for OS layer, including scheduler */ struct xorg_list ready; /* List of clients ready to run */ + struct xorg_list output_pending; /* List of clients with output queued */ Mask clientAsMask; short index; unsigned char majorOp, minorOp; @@ -153,6 +154,25 @@ static inline Bool client_is_ready(ClientPtr client) Bool clients_are_ready(void); +extern struct xorg_list output_pending_clients; + +static inline void +output_pending_mark(ClientPtr client) +{ + if (xorg_list_is_empty(&client->output_pending)) + xorg_list_append(&client->output_pending, &output_pending_clients); +} + +static inline void +output_pending_clear(ClientPtr client) +{ + xorg_list_del(&client->output_pending); +} + +static inline Bool any_output_pending(void) { + return !xorg_list_is_empty(&output_pending_clients); +} + #define SMART_MAX_PRIORITY (20) #define SMART_MIN_PRIORITY (-20) |