[Lldb-commits] [lldb] r248280 - Do not use pthread_setname_np() if we don't have GLIBC or Android.

Vasileios Kalintiris via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 22 07:52:31 PDT 2015


Author: vkalintiris
Date: Tue Sep 22 09:52:31 2015
New Revision: 248280

URL: http://llvm.org/viewvc/llvm-project?rev=248280&view=rev
Log:
Do not use pthread_setname_np() if we don't have GLIBC or Android.

Summary:
pthread_setname_np() is a nonstandard GNU extension and isn't available
in every C library. Check before it's usage that GLIBC is available or
that we are targeting Android.

Reviewers: clayborg, ovyalov

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D13019

Modified:
    lldb/trunk/source/Host/linux/HostThreadLinux.cpp

Modified: lldb/trunk/source/Host/linux/HostThreadLinux.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Host/linux/HostThreadLinux.cpp?rev=248280&r1=248279&r2=248280&view=diff
==============================================================================
--- lldb/trunk/source/Host/linux/HostThreadLinux.cpp (original)
+++ lldb/trunk/source/Host/linux/HostThreadLinux.cpp Tue Sep 22 09:52:31 2015
@@ -30,7 +30,12 @@ HostThreadLinux::HostThreadLinux(lldb::t
 void
 HostThreadLinux::SetName(lldb::thread_t thread, llvm::StringRef name)
 {
+#if (defined(__GLIBC__) && defined(_GNU_SOURCE)) || defined(__ANDROID__)
     ::pthread_setname_np(thread, name.data());
+#else
+    (void) thread;
+    (void) name;
+#endif
 }
 
 void




More information about the lldb-commits mailing list