fix domain pool: block signals in background threads

close #35
This commit is contained in:
Simon Cruanes 2024-10-08 15:28:04 -04:00
parent c3f235f7e9
commit 40e97d969a
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4

View file

@ -95,6 +95,11 @@ let domains_ : (worker_state option * Domain_.t option) Lock.t array =
a [Pool.with_] or [Pool.create() Pool.shutdown()] in a tight loop), and
if nothing happens it tries to stop to free resources. *)
let work_ idx (st : worker_state) : unit =
Thread.sigmask SIG_BLOCK
[
Sys.sigpipe; Sys.sigbus; Sys.sigterm; Sys.sigint; Sys.sigusr1; Sys.sigusr2;
]
|> ignore;
let main_loop () =
let continue = ref true in
while !continue do