mirror of
https://github.com/c-cube/moonpool.git
synced 2025-12-06 03:05:30 -05:00
fixes after reviews
This commit is contained in:
parent
993ee3a197
commit
21f34473b0
4 changed files with 6 additions and 3 deletions
|
|
@ -37,6 +37,7 @@ val run_async : ?fiber:Picos.Fiber.t -> Runner.t -> (unit -> unit) -> unit
|
|||
(** [run_async runner task] schedules the task to run
|
||||
on the given runner. This means [task()] will be executed
|
||||
at some point in the future, possibly in another thread.
|
||||
@param fiber optional initial (picos) fiber state
|
||||
@since 0.5 *)
|
||||
|
||||
val run_wait_block : ?fiber:Picos.Fiber.t -> Runner.t -> (unit -> 'a) -> 'a
|
||||
|
|
@ -46,6 +47,8 @@ val run_wait_block : ?fiber:Picos.Fiber.t -> Runner.t -> (unit -> 'a) -> 'a
|
|||
and returns its result. If [f()] raises an exception, then [run_wait_block pool f]
|
||||
will raise it as well.
|
||||
|
||||
See {!run_async} for more details.
|
||||
|
||||
{b NOTE} be careful with deadlocks (see notes in {!Fut.wait_block}
|
||||
about the required discipline to avoid deadlocks).
|
||||
@raise Shutdown if the runner was already shut down
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ val run_async : ?fiber:fiber -> t -> task -> unit
|
|||
(** [run_async pool f] schedules [f] for later execution on the runner
|
||||
in one of the threads. [f()] will run on one of the runner's
|
||||
worker threads/domains.
|
||||
@param ls if provided, run the task with this initial local storage
|
||||
@param fiber if provided, run the task with this initial fiber data
|
||||
@raise Shutdown if the runner was shut down before [run_async] was called. *)
|
||||
|
||||
val run_wait_block : ?fiber:fiber -> t -> (unit -> 'a) -> 'a
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ let with_handler (type st arg) ~(ops : st ops) (self : st) :
|
|||
Some
|
||||
(fun k ->
|
||||
(* not implemented *)
|
||||
let exn = Failure "Moonpool: cancel_after is not implemented" in
|
||||
let exn = Failure "Moonpool: cancel_after is not supported." in
|
||||
discontinue k exn)
|
||||
| _ -> None
|
||||
in
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ end
|
|||
|
||||
type state = {
|
||||
id_: Id.t;
|
||||
(** Unique per pool. Used to make sure tasks stay within the same pool. *)
|
||||
(** Unique to this pool. Used to make sure tasks stay within the same pool. *)
|
||||
active: bool A.t; (** Becomes [false] when the pool is shutdown. *)
|
||||
mutable workers: worker_state array; (** Fixed set of workers. *)
|
||||
main_q: WL.task_full Queue.t;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue