Skip to content
This repository has been archived by the owner on Jun 22, 2021. It is now read-only.

Can't STOP the uv_run!!! #196

Open
jinfeihan57 opened this issue Apr 17, 2021 · 2 comments
Open

Can't STOP the uv_run!!! #196

jinfeihan57 opened this issue Apr 17, 2021 · 2 comments

Comments

@jinfeihan57
Copy link

  • 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.
@jinfeihan57
Copy link
Author

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.

@bnoordhuis bnoordhuis transferred this issue from libuv/libuv Apr 17, 2021
@bnoordhuis
Copy link
Member

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants