mirror of
https://github.com/c-cube/moonpool.git
synced 2025-12-06 03:05:30 -05:00
rename
This commit is contained in:
parent
997d996c13
commit
0b28898586
1 changed files with 3 additions and 3 deletions
|
|
@ -8,15 +8,15 @@ let main' ?(block_signals = false) () (f : Runner.t -> 'a) : 'a =
|
||||||
in
|
in
|
||||||
let runner = Fifo_pool.Private_.runner_of_state worker_st in
|
let runner = Fifo_pool.Private_.runner_of_state worker_st in
|
||||||
try
|
try
|
||||||
let fiber = Fut.spawn ~on:runner (fun () -> f runner) in
|
let fut = Fut.spawn ~on:runner (fun () -> f runner) in
|
||||||
Fut.on_result fiber (fun _ -> Runner.shutdown_without_waiting runner);
|
Fut.on_result fut (fun _ -> Runner.shutdown_without_waiting runner);
|
||||||
|
|
||||||
(* run the main thread *)
|
(* run the main thread *)
|
||||||
Worker_loop_.worker_loop worker_st
|
Worker_loop_.worker_loop worker_st
|
||||||
~block_signals (* do not disturb existing thread *)
|
~block_signals (* do not disturb existing thread *)
|
||||||
~ops:Fifo_pool.Private_.worker_ops;
|
~ops:Fifo_pool.Private_.worker_ops;
|
||||||
|
|
||||||
match Fut.peek fiber with
|
match Fut.peek fut with
|
||||||
| Some (Ok x) -> x
|
| Some (Ok x) -> x
|
||||||
| Some (Error ebt) -> Exn_bt.raise ebt
|
| Some (Error ebt) -> Exn_bt.raise ebt
|
||||||
| None -> assert false
|
| None -> assert false
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue