diff options
author | emaste <emaste@FreeBSD.org> | 2015-02-06 22:25:21 +0000 |
---|---|---|
committer | emaste <emaste@FreeBSD.org> | 2015-02-06 22:25:21 +0000 |
commit | fa0e7b41694bc598cd3df2405d0384ea29d7537e (patch) | |
tree | 5e5b6a0774e0d93bb4cfa2f9f83b9c41b38c4448 /contrib/llvm/tools/lldb/source/API/SBHostOS.cpp | |
parent | d2b9c88b24f95cd9f8e7bd621cfa454ce759c687 (diff) | |
parent | 0c2019f4ca6b2dc6d710f6bb16a0e3ed10271531 (diff) | |
download | FreeBSD-src-fa0e7b41694bc598cd3df2405d0384ea29d7537e.zip FreeBSD-src-fa0e7b41694bc598cd3df2405d0384ea29d7537e.tar.gz |
Update LLDB snapshot to upstream r225923 (git 2b588ecd)
Sponsored by: DARPA, AFRL
Diffstat (limited to 'contrib/llvm/tools/lldb/source/API/SBHostOS.cpp')
-rw-r--r-- | contrib/llvm/tools/lldb/source/API/SBHostOS.cpp | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/contrib/llvm/tools/lldb/source/API/SBHostOS.cpp b/contrib/llvm/tools/lldb/source/API/SBHostOS.cpp index ec1e2f2..008ca4d 100644 --- a/contrib/llvm/tools/lldb/source/API/SBHostOS.cpp +++ b/contrib/llvm/tools/lldb/source/API/SBHostOS.cpp @@ -13,6 +13,9 @@ #include "lldb/Core/Log.h" #include "lldb/Host/Host.h" #include "lldb/Host/HostInfo.h" +#include "lldb/Host/HostNativeThread.h" +#include "lldb/Host/HostThread.h" +#include "lldb/Host/ThreadLauncher.h" using namespace lldb; using namespace lldb_private; @@ -69,31 +72,54 @@ SBHostOS::ThreadCreate // FIXME: You should log the return value? - return Host::ThreadCreate (name, thread_function, thread_arg, error_ptr ? error_ptr->get() : NULL); + HostThread thread(ThreadLauncher::LaunchThread(name, thread_function, thread_arg, error_ptr ? error_ptr->get() : NULL)); + return thread.Release(); } void SBHostOS::ThreadCreated (const char *name) { - Host::ThreadCreated (name); } bool SBHostOS::ThreadCancel (lldb::thread_t thread, SBError *error_ptr) { - return Host::ThreadCancel (thread, error_ptr ? error_ptr->get() : NULL); + Error error; + HostThread host_thread(thread); + error = host_thread.Cancel(); + if (error_ptr) + error_ptr->SetError(error); + host_thread.Release(); + return error.Success(); } bool SBHostOS::ThreadDetach (lldb::thread_t thread, SBError *error_ptr) { - return Host::ThreadDetach (thread, error_ptr ? error_ptr->get() : NULL); + Error error; +#if defined(_WIN32) + if (error_ptr) + error_ptr->SetErrorString("ThreadDetach is not supported on this platform"); +#else + HostThread host_thread(thread); + error = host_thread.GetNativeThread().Detach(); + if (error_ptr) + error_ptr->SetError(error); + host_thread.Release(); +#endif + return error.Success(); } bool SBHostOS::ThreadJoin (lldb::thread_t thread, lldb::thread_result_t *result, SBError *error_ptr) { - return Host::ThreadJoin (thread, result, error_ptr ? error_ptr->get() : NULL); + Error error; + HostThread host_thread(thread); + error = host_thread.Join(result); + if (error_ptr) + error_ptr->SetError(error); + host_thread.Release(); + return error.Success(); } |