diff options
author | solovyev <solovyev@yandex-team.com> | 2024-02-05 13:38:17 +0300 |
---|---|---|
committer | solovyev <solovyev@yandex-team.com> | 2024-02-05 13:56:16 +0300 |
commit | ab522fc059af1de406446d9481cac06177bd61c9 (patch) | |
tree | 839cb828d2bb93f2186969c67bc67aaaecead3fd | |
parent | 585b5d043f74134383b67b4ac2f4a66feeaf0da7 (diff) | |
download | ydb-ab522fc059af1de406446d9481cac06177bd61c9.tar.gz |
TThread::SetName sets thread name on android
-rw-r--r-- | util/system/thread.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/util/system/thread.cpp b/util/system/thread.cpp index e25ce5327f..8b0d988d23 100644 --- a/util/system/thread.cpp +++ b/util/system/thread.cpp @@ -11,7 +11,7 @@ #include "yassert.h" #include <utility> -#if defined(_linux_) +#if defined(_linux_) || defined(_android_) #include <sys/prctl.h> #endif @@ -472,7 +472,7 @@ void TThread::SetCurrentThreadName(const char* name) { #if defined(_freebsd_) pthread_t thread = pthread_self(); pthread_set_name_np(thread, name); -#elif defined(_linux_) +#elif defined(_linux_) || defined(_android_) prctl(PR_SET_NAME, name, 0, 0, 0); #elif defined(_darwin_) pthread_setname_np(name); |