Create a HostThread abstraction.
This patch moves creates a thread abstraction that represents a
thread running inside the LLDB process. This is a replacement for
otherwise using lldb::thread_t, and provides a platform agnostic
interface to managing these threads.
Differential Revision: http://reviews.llvm.org/D5198
Reviewed by: Jim Ingham
llvm-svn: 217460
diff --git a/lldb/source/Host/freebsd/ThisThread.cpp b/lldb/source/Host/freebsd/ThisThread.cpp
new file mode 100644
index 0000000..6a50618
--- /dev/null
+++ b/lldb/source/Host/freebsd/ThisThread.cpp
@@ -0,0 +1,29 @@
+//===-- 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/linux/HostThreadLinux.h"
+#include "lldb/Host/ThisThread.h"
+
+#include "llvm/ADT/SmallVector.h"
+
+#include <pthread.h>
+
+using namespace lldb_private;
+
+void
+ThisThread::SetName(llvm::StringRef name)
+{
+ HostThread::SetName(::pthread_self(), name);
+}
+
+void
+ThisThread::GetName(llvm::SmallVectorImpl<char> &name)
+{
+ HostThread::GetName(::pthread_self(), name);
+}