aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsolovyev <solovyev@yandex-team.com>2024-02-05 13:38:17 +0300
committerAlexander Smirnov <alex@ydb.tech>2024-02-09 19:18:05 +0300
commita69e3af948d2f21e6a131d8b69861a209cc520e6 (patch)
treee2ef7b1899213fc4b47785718f7e2010cd70af52
parentc2704741fe6ffabc1a85d6bfc421098e91d5420e (diff)
downloadydb-a69e3af948d2f21e6a131d8b69861a209cc520e6.tar.gz
TThread::SetName sets thread name on android
-rw-r--r--util/system/thread.cpp4
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);