tcp_io: fix write_cb busy-loop with deferred callback — turn off write_monitor after flush when waiter_defer=1
This commit is contained in:
1 parent
7d460ca156
commit
0ef7ee597c
1 file changed
+4
@@ -387,6 +387,10 @@ static void write_cb(socket_t sock, void* arg) {
|
|||||||
if (!tc->write_buf) {
|
if (!tc->write_buf) {
|
||||||
DEBUG_TRACE(DEBUG_CATEGORY_SOCKET, "tcp_io: write_cb flushed fd=%d wmon=%d (resume WQ cb)", (int)tc->sock, tc->write_monitor);
|
DEBUG_TRACE(DEBUG_CATEGORY_SOCKET, "tcp_io: write_cb flushed fd=%d wmon=%d (resume WQ cb)", (int)tc->sock, tc->write_monitor);
|
||||||
queue_resume_callback(tc->write_queue);
|
queue_resume_callback(tc->write_queue);
|
||||||
|
if (tc->write_queue->waiter_defer && tc->write_monitor) {
|
||||||
|
uasync_set_socket_write(tc->ua, tc->socket_id, 0);
|
||||||
|
tc->write_monitor = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user