From 27451e692122c8cb0c64f422e03a739e01c76d9a Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Sat, 18 May 2024 13:29:38 +0200 Subject: [PATCH] autoformat --- lib/time.ml | 9 ++++++--- lib/xen.ml | 6 ++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/time.ml b/lib/time.ml index 4f1f330..cc2f44f 100644 --- a/lib/time.ml +++ b/lib/time.ml @@ -34,13 +34,15 @@ type t = int64 module SleepQueue = Binary_heap.Make (struct type t = Mirage_time.sleep - let compare Mirage_time.{ time = t1; _ } Mirage_time.{ time = t2; _ } = compare t1 t2 + let compare Mirage_time.{ time = t1; _ } Mirage_time.{ time = t2; _ } = + compare t1 t2 end) (* Threads waiting for a timeout to expire: *) let sleep_queue = let dummy = - Mirage_time.{ time = time (); canceled = false; thread = Lwt.wait () |> snd } + Mirage_time. + { time = time (); canceled = false; thread = Lwt.wait () |> snd } in SleepQueue.create ~dummy 0 @@ -73,6 +75,7 @@ let rec get_next_timeout () = let select_next () = (* Transfer all sleepers added since the last iteration to the main sleep queue: *) - List.iter (fun e -> SleepQueue.add sleep_queue e) + List.iter + (fun e -> SleepQueue.add sleep_queue e) (Mirage_time.new_sleepers ()); get_next_timeout () diff --git a/lib/xen.ml b/lib/xen.ml index 2a01b5b..cb53597 100644 --- a/lib/xen.ml +++ b/lib/xen.ml @@ -219,13 +219,15 @@ module Export = struct match try_end_access ~release_ref g with | Ok () -> Lwt.return_unit | Error `Busy -> - Mirage_time.sleep_ns ten_seconds_in_ns >>= fun () -> end_access ~release_ref g + Mirage_time.sleep_ns ten_seconds_in_ns >>= fun () -> + end_access ~release_ref g let rec unshare ~release_refs t = match try_unshare ~release_refs t with | Ok () -> Lwt.return_unit | Error `Busy -> - Mirage_time.sleep_ns ten_seconds_in_ns >>= fun () -> unshare ~release_refs t + Mirage_time.sleep_ns ten_seconds_in_ns >>= fun () -> + unshare ~release_refs t let share_pages ~domid ~count ~writable = (* First allocate a list of n pages. *)