For example, I have 2 threads . I want to stop the server from the main thread (Thread 1).
Theme 1: main program
Topic 2: TcpServer
From the libuv library:
UV_EXTERN void uv_stop(uv_loop_t*);
This means that if I called uv_stop(tcp_server_loop)in the main thread, and the server loop would be blocked due to the absence of events on tcpserver, then the server would remain in the loop until any event occurred. (he probably checks to see if there was a call uv_stopbefore the loop goes into blocking mode to wait for new events).
source
share