summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools/lldb/source/Host/freebsd/ThisThread.cpp
blob: fb25847be24f73092a3016391af7a08b0c28f16a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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);
}
OpenPOWER on IntegriCloud