help
help copied to clipboard
Can't STOP the uv_run!!!
- Version: 1.41
- Platform: Red Hat 7.6 I use one thread to run uv_run() and another thread to call uv_stop(). Why uv_run() cannot exit? After debugging, I found that uv_run() is blocked at line 324 of libuv/src/unix/linux-core.c, epoll_wait() function. And the timeout value is -1.
More detals. I use uv_poll_init_socket() uv_poll_start() and uv_poll_stop() to manage tcp connection descriptors. When the connection is disconnected, call uv_poll_stop() to stop poll, and call uv_close() to close uv_tcp_t. Then call uv_stop(). But uv_run() does not stop.
Moved to libuv/help. If you want to wake up the event loop from another thread, use uv_async_send(), then call uv_stop() from the async handle's callback.