robur-coop / miou

A simple scheduler for OCaml 5
https://docs.osau.re/miou/index.html
MIT License
93 stars 7 forks source link

Raise an error if the user uses `Miou_unix.{read,write,sleep}` inside `Miou.run` #17

Closed dinosaure closed 7 months ago

dinosaure commented 7 months ago

The current behavior of such code:

let () = Miou.run @@ fun () ->
  Miou_unix.sleep 1.0

Is a dead program which never finishes. It will be nice to raise an error when the error did not attach the good scheduler depending on syscalls used. Spotted by @kit-ty-kate and by me several times, this error seems enough common to emit an effective explanation.

dinosaure commented 7 months ago

Fixed by https://github.com/robur-coop/miou/commit/7b28889549c702e9715de63a6833807f0fa7de57