@@ -396,9 +396,9 @@ let block loc before =
396
396
if add_awaiter loc before t then
397
397
match Trigger. await t with
398
398
| None -> ()
399
- | Some ( exn , bt ) ->
399
+ | Some exn_bt ->
400
400
remove_awaiter Backoff. default loc before t;
401
- Printexc. raise_with_backtrace exn bt
401
+ Printexc. raise_with_backtrace (fst exn_bt) (snd exn_bt)
402
402
403
403
let rec update_no_alloc backoff loc state f =
404
404
(* Fenceless is safe as we have had a fence before if needed and there is a fence after. *)
@@ -860,19 +860,20 @@ module Xt = struct
860
860
Action. run xt_r.post_commit result
861
861
else begin
862
862
(* We switch to [`Lock_free] as there was interference. *)
863
- commit_once_alloc backoff `Lock_free xt tx
863
+ xt_r.mode < - `Lock_free ;
864
+ commit_once_alloc backoff xt tx
864
865
end
865
866
end
866
867
else if
867
868
a_cmp = status
868
869
|| finish xt root (if 0 < = status then After else Before )
869
870
then Action. run xt_r.post_commit result
870
- else commit_once_alloc backoff xt_r.mode xt tx
871
+ else commit_once_alloc backoff xt tx
871
872
| exception Exit ->
872
873
(* Fenceless is safe as there was a fence before. *)
873
874
if fenceless_get (root_as_atomic xt) == R After then
874
875
Action. run xt_r.post_commit result
875
- else commit_once_alloc backoff xt_r.mode xt tx
876
+ else commit_once_alloc backoff xt tx
876
877
end
877
878
end
878
879
| exception Retry. Invalid -> commit_once_reuse backoff xt tx
@@ -888,37 +889,39 @@ module Xt = struct
888
889
| None ->
889
890
remove_awaiters t xt (T Leaf ) root |> ignore;
890
891
commit_reset_reuse backoff xt tx
891
- | Some ( exn , bt ) ->
892
+ | Some exn_bt ->
892
893
remove_awaiters t xt (T Leaf ) root |> ignore;
893
- Printexc. raise_with_backtrace exn bt
894
+ Printexc. raise_with_backtrace (fst exn_bt) (snd exn_bt)
894
895
end
895
896
| T (Node _ ) as stop ->
896
897
remove_awaiters t xt stop root |> ignore;
897
898
commit_once_reuse backoff xt tx
898
899
end
899
900
end
900
901
901
- and commit_once_reuse backoff xt tx =
902
- check xt;
903
- commit_reuse ( Backoff. once backoff) xt tx
904
-
905
- and commit_reset_reuse backoff xt tx =
902
+ and commit_once_reuse backoff (Xt xt_r as xt : _ t ) tx =
903
+ tree_as_ref xt := T Leaf ;
904
+ xt_r.validate_counter < - initial_validate_period;
905
+ xt_r.post_commit < - Action. noop;
906
+ let backoff = Backoff. once backoff in
906
907
check xt;
907
- commit_reuse ( Backoff. reset backoff) xt tx
908
+ commit backoff xt tx
908
909
909
- and commit_reuse backoff (Xt xt_r as xt : _ t ) tx =
910
+ and commit_reset_reuse backoff (Xt xt_r as xt : _ t ) tx =
910
911
tree_as_ref xt := T Leaf ;
911
912
xt_r.validate_counter < - initial_validate_period;
912
913
xt_r.post_commit < - Action. noop;
914
+ let backoff = Backoff. reset backoff in
915
+ check xt;
913
916
commit backoff xt tx
914
917
915
- and commit_once_alloc backoff mode (Xt xt_r as xt : _ t ) tx =
916
- check xt;
917
- let backoff = Backoff. once backoff in
918
+ and commit_once_alloc backoff (Xt xt_r : _ t ) tx =
918
919
let rot = U Leaf in
919
920
let validate_counter = initial_validate_period in
920
921
let post_commit = Action. noop in
921
- let xt = Xt { xt_r with rot; mode; validate_counter; post_commit } in
922
+ let xt = Xt { xt_r with rot; validate_counter; post_commit } in
923
+ let backoff = Backoff. once backoff in
924
+ check xt;
922
925
commit backoff xt tx
923
926
924
927
let [@ inline] commit ?(backoff = Backoff. default) ?(mode = `Obstruction_free )
0 commit comments