1 //===-- HostThreadPosix.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/posix/HostThreadPosix.h"
11 #include "lldb/Utility/Status.h"
17 using namespace lldb_private;
19 HostThreadPosix::HostThreadPosix() {}
21 HostThreadPosix::HostThreadPosix(lldb::thread_t thread)
22 : HostNativeThreadBase(thread) {}
24 HostThreadPosix::~HostThreadPosix() {}
26 Status HostThreadPosix::Join(lldb::thread_result_t *result) {
29 int err = ::pthread_join(m_thread, result);
30 error.SetError(err, lldb::eErrorTypePOSIX);
34 error.SetError(EINVAL, eErrorTypePOSIX);
41 Status HostThreadPosix::Cancel() {
46 assert(false && "someone is calling HostThread::Cancel()");
48 int err = ::pthread_cancel(m_thread);
49 error.SetError(err, eErrorTypePOSIX);
51 error.SetErrorString("HostThreadPosix::Cancel() not supported on Android");
57 Status HostThreadPosix::Detach() {
60 int err = ::pthread_detach(m_thread);
61 error.SetError(err, eErrorTypePOSIX);