diff --git a/src/core/tools/tutils.ml b/src/core/tools/tutils.ml index cef2b88e49..962b3c9ead 100644 --- a/src/core/tools/tutils.ml +++ b/src/core/tools/tutils.ml @@ -156,7 +156,7 @@ let create ~queue f x s = (fun () -> let id = let process x = - Utils.set_thread_name s; + Utils.Thread.set_current_thread_name s; try f x; Mutex_utils.mutexify lock diff --git a/src/core/tools/unix_c.c b/src/core/tools/unix_c.c index e3710b2f20..46fe7e0a5c 100644 --- a/src/core/tools/unix_c.c +++ b/src/core/tools/unix_c.c @@ -94,7 +94,7 @@ CAMLprim value liquidsoap_get_pagesize() { #endif } -CAMLprim value liquidsoap_set_thread_name(value _name) { +CAMLprim value liquidsoap_set_current_thread_name(value _name) { #if defined(_WIN32) char_os *thread_name = caml_stat_strdup_to_os(String_val(_name)); SetThreadDescription(GetCurrentThread(), thread_name); diff --git a/src/core/tools/utils.ml b/src/core/tools/utils.ml index 16074d5b9a..47baa170e0 100644 --- a/src/core/tools/utils.ml +++ b/src/core/tools/utils.ml @@ -32,7 +32,12 @@ let log_exception ~(log : Log.t) ~bt msg = log#severe "%s" msg; if log#active 4 (* info *) then log#info "%s" bt -external set_thread_name : string -> unit = "liquidsoap_set_thread_name" +module Thread = struct + external set_current_thread_name : string -> unit + = "liquidsoap_set_current_thread_name" + + include Thread +end (* Force locale *) external force_locale : string -> unit = "liquidsoap_set_locale"