Files
clang-p2996/lldb/source/Host/freebsd/ThisThread.cpp
Ed Maste 3b7382da74 Move FreeBSD's thread SetName implementation to ThisThread
SetName is only used in LLDB to set a thead's own name.  Move it there
to match OS X and Windows and slightly reduce the effort in any future
HostThread/ThisThread name refactoring.

llvm-svn: 217521
2014-09-10 17:09:46 +00:00

31 lines
768 B
C++

//===-- 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);
}