From 0ad765b356787b90ef350ba94b045fddfe59ddb3 Mon Sep 17 00:00:00 2001 From: Hongli Lai Date: Sun, 6 Oct 2024 16:17:01 +0200 Subject: [PATCH] native thread name --- src/cxx_supportlib/oxt/implementation.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cxx_supportlib/oxt/implementation.cpp b/src/cxx_supportlib/oxt/implementation.cpp index 978ab4e3e7..5c2f686680 100644 --- a/src/cxx_supportlib/oxt/implementation.cpp +++ b/src/cxx_supportlib/oxt/implementation.cpp @@ -397,7 +397,9 @@ thread::make_thread_name(const string &given_name) { static void set_native_thread_name(const string &name) { - #if defined(__APPLE__) || defined(__linux__) || defined(__FreeBSD__) + #if defined(__linux__) + pthread_setname_np(pthread_self(), name.c_str()); + #elif defined(__APPLE__) || defined(__FreeBSD__) pthread_setname_np(name.c_str()); #endif }