Skip to content

Commit 95d0387

Browse files
authored
Chore: Explicitly call Stdlib.Mutex in file with open Base (ocaml#9929)
* Explicitly call Stdlib.Mutex in file with open Base Signed-off-by: Ambre Austen Suhamy <[email protected]> * Silence deprecation alert with note to upgrade Signed-off-by: Ambre Austen Suhamy <[email protected]> --------- Signed-off-by: Ambre Austen Suhamy <[email protected]>
1 parent 5d8d3e9 commit 95d0387

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/expect-tests/dune_file_watcher/dune_file_watcher_tests_lib.ml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ open Base
44
open Stdune
55

66
let critical_section mutex ~f =
7+
(* Since 5.0, using "Mutex" with Base open rings an alert and suggests
8+
we use "Stdlib.Mutex" instead.
9+
Prior to OCaml 5.0, "Stdlib.Mutex" didn't exist, it was just "Mutex".
10+
Since 5.1 there is Stdlib.Mutex.protect which replaces this function.
11+
*)
12+
let module Mutex = Mutex [@alert "-deprecated"] in
713
Mutex.lock mutex;
814
Exn.protect ~f ~finally:(fun () -> Mutex.unlock mutex)
915
;;

0 commit comments

Comments
 (0)