@@ -706,51 +706,6 @@ module Private : sig
706706 because you need to unlock a mutex if cancelled). *)
707707 end
708708
709- (* * A queue of fibers waiting for an event. *)
710- module Waiters : sig
711- type 'a t
712- (* A queue of fibers waiting for something.
713- Note: an [_ t] is not thread-safe itself.
714- To use share it between domains, the user is responsible for wrapping it in a mutex. *)
715-
716- val create : unit -> 'a t
717-
718- val wake_all : 'a t -> 'a -> unit
719- (* * [wake_all t] calls (and removes) all the functions waiting on [t].
720- If [t] is shared between domains, the caller must hold the mutex while calling this. *)
721-
722- val wake_one : 'a t -> 'a -> [`Ok | `Queue_empty ]
723- (* * [wake_one t] is like {!wake_all}, but only calls (and removes) the first waiter in the queue.
724- If [t] is shared between domains, the caller must hold the mutex while calling this. *)
725-
726- val is_empty : 'a t -> bool
727- (* * [is_empty t] checks whether there are any functions waiting on [t].
728- If [t] is shared between domains, the caller must hold the mutex while calling this,
729- and the result is valid until the mutex is released. *)
730-
731- val await :
732- mutex :Mutex .t option ->
733- 'a t -> Ctf .id -> 'a
734- (* * [await ~mutex t id] suspends the current fiber and adds its continuation to [t].
735- When the waiter is woken, the fiber is resumed and returns the result.
736- If [t] can be used from multiple domains:
737- - [mutex] must be set to the mutex to use to unlock it.
738- - [mutex] must be already held when calling this function, which will unlock it before blocking.
739- When [await] returns, [mutex] will have been unlocked.
740- @raise Cancel.Cancelled if the fiber's context is cancelled *)
741-
742- val await_internal :
743- mutex :Mutex .t option ->
744- 'a t -> Ctf .id -> Fiber_context .t ->
745- (('a , exn ) result -> unit ) -> unit
746- (* * [await_internal ~mutex t id ctx enqueue] is like [await], but the caller has to suspend the fiber.
747- This also allows wrapping the [enqueue] function.
748- Calls [enqueue (Error (Cancelled _))] if cancelled.
749- Note: [enqueue] is called from the triggering domain,
750- which is currently calling {!wake_one} or {!wake_all}
751- and must therefore be holding [mutex]. *)
752- end
753-
754709 module Debug : sig
755710 val traceln :
756711 ?__POS__:string * int * int * int ->
0 commit comments