From 2ce3fa7d3e60354013d68e841e401a5cd8434d91 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Tue, 11 Nov 2025 00:01:11 -0500 Subject: [PATCH] docs --- src/dpool/moonpool_dpool.ml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dpool/moonpool_dpool.ml b/src/dpool/moonpool_dpool.ml index 42917c1a..953b323d 100644 --- a/src/dpool/moonpool_dpool.ml +++ b/src/dpool/moonpool_dpool.ml @@ -146,7 +146,7 @@ let work_ idx (st : worker_state) : unit = let () = assert (Domain_.is_main_domain ()); let w = { th_count = Atomic.make 1; q = Bb_queue.create () } in - (* thread that stays alive *) + (* thread that stays alive since [th_count>0] will always hold *) ignore (Thread.create (fun () -> work_ 0 w) () : Thread.t); domains_.(0) <- Lock.create (Some w, None) @@ -154,7 +154,8 @@ let[@inline] max_number_of_domains () : int = Array.length domains_ let run_on (i : int) (f : unit -> unit) : unit = assert (i < Array.length domains_); - let w = + + let w : worker_state = Lock.update_map domains_.(i) (function | (Some w, _) as st -> Atomic.incr w.th_count;