[PATCH 4/6] server: Don't poll for POLLOUT if there are alerted write asyncs.

Zebediah Figura zfigura at codeweavers.com
Thu May 5 00:43:28 CDT 2022


Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
 server/sock.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/server/sock.c b/server/sock.c
index 2bb2963a840..cb76765e495 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -1315,7 +1315,12 @@ static int sock_get_poll_events( struct fd *fd )
 
         if (async_queued( &sock->write_q ))
         {
-            if (async_waiting( &sock->write_q )) ev |= POLLOUT;
+            /* As with read asyncs above, clear POLLOUT if we have an alerted
+             * async. */
+            if (async_waiting( &sock->write_q ))
+                ev |= POLLOUT;
+            else
+                ev &= ~POLLOUT;
         }
         else if (!sock->wr_shutdown && (mask & AFD_POLL_WRITE))
         {
-- 
2.34.1




More information about the wine-devel mailing list