Wait using a condition variable in server

Currently, server_stop() is called from the same thread as
server_connect_to(), so interruption may never happen.

This is a step to prepare executing the server from a dedicated thread.
This commit is contained in:
Romain Vimont
2021-10-31 14:56:37 +01:00
parent a54dc8212f
commit 5b9c88693e
2 changed files with 45 additions and 4 deletions

View File

@@ -47,6 +47,10 @@ struct server {
// alive only between start() and stop()
struct sc_process_observer observer;
sc_mutex mutex;
sc_cond cond_stopped;
bool stopped;
sc_socket server_socket; // only used if !tunnel_forward
sc_socket video_socket;
sc_socket control_socket;