Skip to content

Commit

Permalink
use check_configured instead
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Sep 5, 2024
1 parent 7841273 commit 43676f5
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/io/moonpool_io.ml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,9 @@ module Select = Picos_io_select

let fd_of_unix_fd : Unix.file_descr -> Fd.t = Fun.id

open struct
let has_configured = Atomic.make false
end

let configure ?intr_sig ?handle_sigchld ?ignore_sigpipe () : unit =
if not (Atomic.exchange has_configured true) then
Select.configure ?intr_sig ?handle_sigchld ?ignore_sigpipe ()

(** [main f] runs [f()] inside a scheduler. *)
let main ?intr_sig ?handle_sigchld ?ignore_sigpipe (f : Moonpool.Runner.t -> 'a)
: 'a =
configure ?intr_sig ?handle_sigchld ?ignore_sigpipe ();
let main (f : Moonpool.Runner.t -> 'a) : 'a =
Picos_io_select.check_configured ();
Moonpool_fib.main f

(** {2 Async read/write} *)
Expand Down

0 comments on commit 43676f5

Please sign in to comment.