]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/source/Host/freebsd/ThisThread.cpp
Update LLDB snapshot to upstream r225923 (git 2b588ecd)
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / source / Host / freebsd / ThisThread.cpp
1 //===-- ThisThread.cpp ------------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #include "lldb/Host/HostNativeThread.h"
11 #include "lldb/Host/ThisThread.h"
12
13 #include "llvm/ADT/SmallVector.h"
14
15 #include <pthread.h>
16 #include <pthread_np.h>
17
18 using namespace lldb_private;
19
20 void
21 ThisThread::SetName(llvm::StringRef name)
22 {
23     ::pthread_set_name_np(::pthread_self(), name.data());
24 }
25
26 void
27 ThisThread::GetName(llvm::SmallVectorImpl<char> &name)
28 {
29     HostNativeThread::GetName(::pthread_getthreadid_np(), name);
30 }