Zebediah Figura : server: Do not signal write bits if there are write asyncs alerted.
Module: wine Branch: master Commit: bff228c198597f4a1c43432988a2d61f93df5bc9 URL: https://source.winehq.org/git/wine.git/?a=commit;h=bff228c198597f4a1c4343298... Author: Zebediah Figura <zfigura(a)codeweavers.com> Date: Thu May 5 00:43:29 2022 -0500 server: Do not signal write bits if there are write asyncs alerted. Asyncs which are alerted but not "waiting" may still fill the pipe, and we shouldn't signal AFD_POLL_WRITE in that case. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- server/sock.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/server/sock.c b/server/sock.c index cb76765e495..aa62a03d699 100644 --- a/server/sock.c +++ b/server/sock.c @@ -1011,10 +1011,13 @@ static int sock_dispatch_asyncs( struct sock *sock, int event, int error ) event &= ~(POLLIN | POLLPRI); } - if (event & POLLOUT && async_waiting( &sock->write_q )) + if ((event & POLLOUT) && async_queued( &sock->write_q )) { - if (debug_level) fprintf( stderr, "activating write queue for socket %p\n", sock ); - async_wake_up( &sock->write_q, STATUS_ALERTED ); + if (async_waiting( &sock->write_q )) + { + if (debug_level) fprintf( stderr, "activating write queue for socket %p\n", sock ); + async_wake_up( &sock->write_q, STATUS_ALERTED ); + } event &= ~POLLOUT; }
participants (1)
-
Alexandre Julliard