ocaml-multicore / eio

Effects-based direct-style IO for multicore OCaml
Other
562 stars 71 forks source link

eio_linux: avoid triggering a TSan warning #754

Closed talex5 closed 2 months ago

talex5 commented 2 months ago

TSan warns that setting statx_works races with users of it. This isn't really a problem, because we always set it to the same value, but it's distracting when looking for other bugs.

Reported by @avsm in #751.

Test-case:

open Eio.Std

let () =
  Eio_main.run @@ fun env ->
  Fiber.both
    (fun () ->
       Eio.Domain_manager.run env#domain_mgr (fun () -> Eio_unix.sleep 100.);
    )
    (fun () ->
       while true do
         ignore (Eio.Path.stat ~follow:false (Eio.Stdenv.cwd env) : Eio.File.Stat.t)
       done
    )
avsm commented 2 months ago

This is very handy to filter out the noise, thanks!