From f947c309f10a75b80fb278cca3bea6b22e168b7d Mon Sep 17 00:00:00 2001 From: lijiamin2019 Date: Sat, 6 May 2023 09:43:12 +0800 Subject: [PATCH] fixed 2248456 from https://gitee.com/lijiamin2019/arkcompiler_toolchain/pulls/250 Set pthread name for ios platform Signed-off-by: lijiamin2019 Change-Id: Ic05a3862bcec5f704043bdedc46a54a7ff876e9f --- inspector/BUILD.gn | 10 +++++----- inspector/connect_inspector.cpp | 6 +++++- inspector/inspector.cpp | 5 +++++ 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/inspector/BUILD.gn b/inspector/BUILD.gn index 2c47f0ed..4fff531f 100644 --- a/inspector/BUILD.gn +++ b/inspector/BUILD.gn @@ -42,11 +42,6 @@ config("ark_platform_config") { ] } else if (is_mingw) { defines += [ "WINDOWS_PLATFORM" ] - } else if (is_mac) { - defines += [ - "MAC_PLATFORM", - "UNIX_PLATFORM", - ] } else if (target_os == "android") { if (!ark_standalone_build) { defines += [ @@ -61,6 +56,11 @@ config("ark_platform_config") { "UNIX_PLATFORM", "IOS_PLATFORM", ] + } else if (is_mac) { + defines += [ + "MAC_PLATFORM", + "UNIX_PLATFORM", + ] } else { defines += [ "UNIX_PLATFORM" ] } diff --git a/inspector/connect_inspector.cpp b/inspector/connect_inspector.cpp index 4ec8d29c..833899d7 100644 --- a/inspector/connect_inspector.cpp +++ b/inspector/connect_inspector.cpp @@ -28,8 +28,12 @@ void* HandleDebugManager(void* const server) LOGE("HandleDebugManager server nullptr"); return nullptr; } - +#if defined(IOS_PLATFORM) || defined(MAC_PLATFORM) + pthread_setname_np("DebugConnectThread"); +#else pthread_setname_np(pthread_self(), "DebugConnectThread"); +#endif + static_cast(server)->RunServer(); return nullptr; } diff --git a/inspector/inspector.cpp b/inspector/inspector.cpp index cf02489b..022eec8e 100644 --- a/inspector/inspector.cpp +++ b/inspector/inspector.cpp @@ -76,7 +76,12 @@ void* HandleClient(void* const server) return nullptr; } +#if defined(IOS_PLATFORM) || defined(MAC_PLATFORM) + pthread_setname_np("DebugThread"); +#else pthread_setname_np(pthread_self(), "DebugThread"); +#endif + static_cast(server)->RunServer(); return nullptr; } -- Gitee