Skip to content

Commit 424f5e8

Browse files
committed
Move Dla to eio.utils
It doesn't need to be in eio.core, as nothing else there depends on it.
1 parent 89019dd commit 424f5e8

File tree

11 files changed

+10
-14
lines changed

11 files changed

+10
-14
lines changed

lib_eio/core/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
(library
22
(name eio__core)
33
(public_name eio.core)
4-
(libraries hmap lwt-dllist fmt optint domain-local-await eio.runtime_events))
4+
(libraries hmap lwt-dllist fmt optint eio.runtime_events))

lib_eio/core/eio__core.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,4 @@ module Private = struct
1919
| Fork = Fiber.Fork
2020
| Get_context = Cancel.Get_context
2121
end
22-
23-
module Dla = Dla
2422
end

lib_eio/core/eio__core.mli

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -782,8 +782,4 @@ module Private : sig
782782
val v : t
783783
(** Backends should use this for {!Eio.Stdenv.debug}. *)
784784
end
785-
786-
module Dla : sig
787-
val prepare_for_await : unit -> Domain_local_await.t
788-
end
789785
end

lib_eio/mock/backend.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ let run_full main =
105105
let result = ref None in
106106
let `Exit_scheduler =
107107
Domain_local_await.using
108-
~prepare_for_await:Eio.Private.Dla.prepare_for_await
108+
~prepare_for_await:Eio_utils.Dla.prepare_for_await
109109
~while_running:(fun () ->
110110
fork ~new_fiber (fun () -> result := Some (main stdenv))) in
111111
match !result with

lib_eio/core/dla.ml renamed to lib_eio/utils/dla.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ let prepare_for_await () =
77
| _ -> ()
88
and await () =
99
if Atomic.get state != `Released then
10-
Suspend.enter "domain-local-await" @@ fun ctx enqueue ->
10+
Eio.Private.Suspend.enter "domain-local-await" @@ fun ctx enqueue ->
1111
let awaiting = `Awaiting enqueue in
1212
if Atomic.compare_and_set state `Init awaiting then (
13-
Cancel.Fiber_context.set_cancel_fn ctx (fun ex ->
13+
Eio.Private.Fiber_context.set_cancel_fn ctx (fun ex ->
1414
if Atomic.compare_and_set state awaiting `Released then (
1515
enqueue (Error ex)
1616
)

lib_eio/utils/dla.mli

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
val prepare_for_await : unit -> Domain_local_await.t

lib_eio/utils/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
(library
22
(name eio_utils)
33
(public_name eio.utils)
4-
(libraries eio psq fmt optint))
4+
(libraries eio psq fmt optint domain-local-await))

lib_eio/utils/eio_utils.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
module Lf_queue = Lf_queue
66
module Suspended = Suspended
77
module Zzz = Zzz
8+
module Dla = Dla

lib_eio_linux/sched.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ let run ~extra_effects st main arg =
460460
let `Exit_scheduler =
461461
let new_fiber = Fiber_context.make_root () in
462462
Domain_local_await.using
463-
~prepare_for_await:Eio.Private.Dla.prepare_for_await
463+
~prepare_for_await:Eio_utils.Dla.prepare_for_await
464464
~while_running:(fun () ->
465465
fork ~new_fiber (fun () ->
466466
Switch.run_protected ~name:"eio_linux" (fun sw ->

lib_eio_posix/sched.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ let run ~extra_effects t main x =
379379
let `Exit_scheduler =
380380
let new_fiber = Fiber_context.make_root () in
381381
Domain_local_await.using
382-
~prepare_for_await:Eio.Private.Dla.prepare_for_await
382+
~prepare_for_await:Eio_utils.Dla.prepare_for_await
383383
~while_running:(fun () ->
384384
fork ~new_fiber (fun () ->
385385
Eio_unix.Private.Thread_pool.run t.thread_pool @@ fun () ->

0 commit comments

Comments
 (0)