Introduce process observer

Add a tool to easily observe process termination.

This allows to move this complexity out of the server code.
This commit is contained in:
Romain Vimont
2021-11-12 09:49:37 +01:00
parent aa011832c1
commit 03de9224fc
4 changed files with 171 additions and 53 deletions

View File

@@ -22,12 +22,10 @@ struct server_info {
struct server {
char *serial;
sc_pid process;
sc_thread wait_server_thread;
sc_mutex mutex;
sc_cond process_terminated_cond;
bool process_terminated;
sc_pid process;
// alive only between start() and stop()
struct sc_process_observer observer;
sc_socket server_socket; // only used if !tunnel_forward
sc_socket video_socket;