From 9f2177dff511cdeaeda743332805a3eb40163077 Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Thu, 21 Mar 2024 12:41:47 -0400 Subject: [PATCH] do not depend on moonpool.fib in core --- src/core/log_ctx.ml | 12 ++++++------ src/thread/dune | 1 - 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/core/log_ctx.ml b/src/core/log_ctx.ml index a3bdbf31..21f66c75 100644 --- a/src/core/log_ctx.ml +++ b/src/core/log_ctx.ml @@ -1,15 +1,15 @@ -module FLS = Moonpool_fib.Fls +module LS = Moonpool.Task_local_storage type 'a tag = 'a Logs.Tag.def (** Storage key for the ambient context. *) -let ctx_k : Logs.Tag.t Str_map.t FLS.key = - FLS.new_key ~init:(fun () -> Str_map.empty) () +let ctx_k : Logs.Tag.t Str_map.t LS.key = + LS.new_key ~init:(fun () -> Str_map.empty) () let create_tag ?doc name pp : _ tag = Logs.Tag.def ?doc name pp let get_tags_from_ctx () : Logs.Tag.set = - match FLS.get ctx_k with + match LS.get ctx_k with | exception Failure _ -> Logs.Tag.empty | map -> (* build the current set of tags *) @@ -18,10 +18,10 @@ let get_tags_from_ctx () : Logs.Tag.set = map Logs.Tag.empty let with_tag (tag : _ tag) v (f : unit -> 'b) : 'b = - match FLS.get ctx_k with + match LS.get ctx_k with | exception Failure _ -> f () | old_map -> let new_map = Str_map.add (Logs.Tag.name tag) (Logs.Tag.V (tag, v)) old_map in - FLS.with_value ctx_k new_map f + LS.with_value ctx_k new_map f diff --git a/src/thread/dune b/src/thread/dune index f9bc784a..29e7666a 100644 --- a/src/thread/dune +++ b/src/thread/dune @@ -12,7 +12,6 @@ containers threads.posix moonpool - moonpool.fib imandrakit hmap ptime