Skip to content

Commit 534f89c

Browse files
authored
Merge pull request #754 from talex5/quiet-tsan
eio_linux: avoid triggering a TSan warning
2 parents e2dc1d7 + 9ca440a commit 534f89c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib_eio_linux/sched.ml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,10 @@ let with_sched ?(fallback=no_fallback) config fn =
521521
Uring.exit uring;
522522
fallback (`Msg "Linux >= 5.15 is required for io_uring support")
523523
) else (
524-
statx_works := Uring.op_supported probe Uring.Op.msg_ring;
524+
(* The reason for an if here is to make sure we only set it once, when
525+
the first domain is starting. This is just to avoid a tsan warning. *)
526+
if not !statx_works && Uring.op_supported probe Uring.Op.msg_ring then
527+
statx_works := true;
525528
match
526529
let mem =
527530
let fixed_buf_len = block_size * n_blocks in

0 commit comments

Comments
 (0)