File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -743,7 +743,7 @@ module Xt = struct
743743
744744 type 'a tx = { tx : 'x . xt :'x t -> 'a } [@@ unboxed]
745745
746- let call { tx } = tx [@@ inline]
746+ let call ~ xt { tx } = tx ~xt [@@ inline]
747747
748748 let rec add_awaiters awaiter casn = function
749749 | NIL as cont -> cont
Original file line number Diff line number Diff line change @@ -345,7 +345,7 @@ module Xt : sig
345345 explicit transaction log. The universal quantification helps to ensure
346346 that the transaction log cannot accidentally escape. *)
347347
348- val call : 'a tx -> xt :' x t -> 'a
348+ val call : xt :' x t -> 'a tx -> 'a
349349 (* * [call ~xt tx] is equivalent to [tx.Xt.tx ~xt]. *)
350350
351351 val commit : ?backoff : Backoff .t -> ?mode : Mode .t -> 'a tx -> 'a
Original file line number Diff line number Diff line change @@ -555,6 +555,15 @@ let test_rollback () =
555555
556556(* *)
557557
558+ let test_call () =
559+ let never = Xt. { tx = (fun ~xt :_ -> Retry. later () ) } in
560+ let result =
561+ Xt. commit { tx = Xt. first [ Xt. call never; (fun ~xt :_ -> 101 ) ] }
562+ in
563+ assert (result = 101 )
564+
565+ (* *)
566+
558567let test_mode () =
559568 assert (Loc. get_mode (Loc. make ~mode: Mode. lock_free 0 ) == Mode. lock_free);
560569 assert (
@@ -598,6 +607,7 @@ let () =
598607 test_periodic_validation () ;
599608 test_explicit_validation () ;
600609 test_rollback () ;
610+ test_call () ;
601611 test_mode () ;
602612 test_xt () ;
603613 Printf. printf " Test suite OK!\n %!"
You can’t perform that action at this time.
0 commit comments