summaryrefslogtreecommitdiffstats
path: root/source/API/SBHostOS.cpp
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2015-02-06 21:38:51 +0000
committeremaste <emaste@FreeBSD.org>2015-02-06 21:38:51 +0000
commit0c2019f4ca6b2dc6d710f6bb16a0e3ed10271531 (patch)
tree09bc83f73246ee3c7a779605cd0122093d2a8a19 /source/API/SBHostOS.cpp
parent01ee1789d6aa7294e5966a97f8d29387f6f81699 (diff)
downloadFreeBSD-src-0c2019f4ca6b2dc6d710f6bb16a0e3ed10271531.zip
FreeBSD-src-0c2019f4ca6b2dc6d710f6bb16a0e3ed10271531.tar.gz
Import LLDB as of upstream SVN r225923 (git 2b588ecd)
This corresponds with the branchpoint for the 3.6 release. A number of files not required for the FreeBSD build have been removed. Sponsored by: DARPA, AFRL
Diffstat (limited to 'source/API/SBHostOS.cpp')
-rw-r--r--source/API/SBHostOS.cpp36
1 files changed, 31 insertions, 5 deletions
diff --git a/source/API/SBHostOS.cpp b/source/API/SBHostOS.cpp
index ec1e2f2..008ca4d 100644
--- a/source/API/SBHostOS.cpp
+++ b/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();
}
OpenPOWER on IntegriCloud