add comment about the reset of the waiter

This commit is contained in:
Hannes Mehnert 2024-10-29 10:51:46 +01:00
parent 931c0481d7
commit 1327cc4f94

View file

@ -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 -> ());