In the code below on OCaml 4.07 the
Thread.delay blocks the delivery of a signal whereas in OCaml 4.06 the signal handler would be invoked. Is this as expected or should this be filed as a bug?
I understand the signals are not delivered at every point but the previous behaviour was quite useful to get out of sleeping threads when a program receives a
(* ocamlc -thread -o foo unix.cma threads.cma foo.ml *) let on_sigterm _ = prerr_endline "Received signal"; flush stderr; exit 0 let () = Sys.set_signal Sys.sigterm Sys.(Signal_handle on_sigterm); Sys.catch_break true; while true; do Thread.delay 300. done