ocaml-flambda / flambda-backend

The Flambda backend project for OCaml
93 stars 67 forks source link

Fix signal_handler_run_in_c_thread test #2701

Closed stedolan closed 3 weeks ago

stedolan commented 3 weeks ago

The C code of the signal_handler_run_in_c_thread test was broken in various ways (calling pthread_cond_wait without holding the corresponding mutex, race condition between wait and signal, no looping around wait), and deadlocked approx once every 1k runs. This patch fixes these issues, and the test then passed 200k times on my machine.