1 //===-- ThisThread.cpp ------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #include "lldb/Host/HostNativeThread.h"
11 #include "lldb/Host/ThisThread.h"
13 #include "llvm/ADT/SmallVector.h"
16 #include <pthread_np.h>
18 using namespace lldb_private;
21 ThisThread::SetName(llvm::StringRef name)
23 ::pthread_set_name_np(::pthread_self(), name.data());
27 ThisThread::GetName(llvm::SmallVectorImpl<char> &name)
29 HostNativeThread::GetName(::pthread_getthreadid_np(), name);