From 1327cc4f94b814ef28c75baf4d2d60b01d1ed906 Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Tue, 29 Oct 2024 10:51:46 +0100 Subject: [PATCH] add comment about the reset of the waiter --- src/git_kv.ml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/git_kv.ml b/src/git_kv.ml index d77cee4..a6be55b 100644 --- a/src/git_kv.ml +++ b/src/git_kv.ml @@ -723,6 +723,9 @@ module Make (Pclock : Mirage_clock.PCLOCK) = struct (fun err -> `Msg (Fmt.str "error pushing %a" Store.pp_error err)) >>= fun res -> Lwt.wakeup_later wk () ; + (* (hannes) since some other task may have mutated the + change_and_push_waiter, we only reset it to None if there's a physical + equality between its value and our created task above. *) (match t.change_and_push_waiter with | Some th' -> if th' == th then t.change_and_push_waiter <- None | None -> ());