mirror of
https://github.com/c-cube/tiny_httpd.git
synced 2025-12-06 11:15:35 -05:00
fix: wait for threads to terminate when shutting down server
This commit is contained in:
parent
b3b99af7ae
commit
6560d4b865
1 changed files with 3 additions and 0 deletions
|
|
@ -971,6 +971,9 @@ module Unix_tcp_server_ = struct
|
||||||
k "Unix.accept or Thread.create raised an exception: %s"
|
k "Unix.accept or Thread.create raised an exception: %s"
|
||||||
(Printexc.to_string e))
|
(Printexc.to_string e))
|
||||||
done;
|
done;
|
||||||
|
|
||||||
|
(* Wait for all threads to be done: this only works if all threads are done. *)
|
||||||
|
Sem_.acquire self.sem_max_connections.max self.sem_max_connections;
|
||||||
());
|
());
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue