summaryrefslogtreecommitdiff
path: root/source/Host/freebsd/ThisThread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/Host/freebsd/ThisThread.cpp')
-rw-r--r--source/Host/freebsd/ThisThread.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/source/Host/freebsd/ThisThread.cpp b/source/Host/freebsd/ThisThread.cpp
new file mode 100644
index 0000000000000..fb25847be24f7
--- /dev/null
+++ b/source/Host/freebsd/ThisThread.cpp
@@ -0,0 +1,30 @@
+//===-- ThisThread.cpp ------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Host/HostNativeThread.h"
+#include "lldb/Host/ThisThread.h"
+
+#include "llvm/ADT/SmallVector.h"
+
+#include <pthread.h>
+#include <pthread_np.h>
+
+using namespace lldb_private;
+
+void
+ThisThread::SetName(llvm::StringRef name)
+{
+ ::pthread_set_name_np(::pthread_self(), name.data());
+}
+
+void
+ThisThread::GetName(llvm::SmallVectorImpl<char> &name)
+{
+ HostNativeThread::GetName(::pthread_getthreadid_np(), name);
+}