File tree Expand file tree Collapse file tree 3 files changed +15
-7
lines changed Expand file tree Collapse file tree 3 files changed +15
-7
lines changed Original file line number Diff line number Diff line change 15
15
backoff
16
16
threads.posix
17
17
psq
18
+ multicore-magic
18
19
mtime
19
20
mtime.clock.os))
20
21
Original file line number Diff line number Diff line change @@ -319,6 +319,9 @@ let configure ?(intr_sig = Sys.sigusr2) ?(handle_sigchld = true)
319
319
reconfigure_signal_handlers ()
320
320
321
321
let check_configured () =
322
+ (* [instantenous_domain_index] uses [Domain.at_exit] and we want to ensure it
323
+ is called as early as possible. *)
324
+ Multicore_magic. instantaneous_domain_index () |> ignore;
322
325
if config.intr_sigs == [] then configure ()
323
326
else reconfigure_signal_handlers ()
324
327
Original file line number Diff line number Diff line change @@ -124,18 +124,22 @@ val configure :
124
124
thread on the main domain before any threads or domains besides the main are
125
125
created or spawned. *)
126
126
127
- val handle_signal : int -> unit
128
- (* * [handle_signal signum] should be called to notify this module of a signal
129
- when {{!configure} configured} to not handle said signals. *)
130
-
131
127
val check_configured : unit -> unit
132
128
(* * [check_configured ()] checks whether this module has already been
133
129
{{!configure} configured} or not and, if not, calls {!configure} with
134
130
default arguments. In either case, calling [check_configured ()] will
135
- (re)configure signal handling for the current thread.
131
+ (re)configure signal handling for the current thread and perform other
132
+ required initialization for the thread to use this module.
133
+
134
+ ⚠️ This should be called at the start of every thread using this module.
136
135
137
- ℹ️ The intended use case for [check_configure ()] is at the point of
138
- entry of schedulers and other facilities that use this module. *)
136
+ ℹ️ The intended use case for [check_configured ()] is at the point of entry
137
+ of schedulers and other facilities that use this module. In other words,
138
+ application code should ideally not need to call this directly. *)
139
+
140
+ val handle_signal : int -> unit
141
+ (* * [handle_signal signum] should be called to notify this module of a signal
142
+ when {{!configure} configured} to not handle said signals. *)
139
143
140
144
(* * {1 Examples}
141
145
You can’t perform that action at this time.
0 commit comments