summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/common/TaskPool.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-07-05 17:42:08 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-07-05 17:42:08 +0000
commitf39c2e188d811ede3758eb98aa0201c1c8f978a1 (patch)
treee8642eccc48fd93d723b35a66bfb7178ba297777 /lldb/source/Host/common/TaskPool.cpp
parent6e6d229e5e95b00964656ae1a555bc843e37926d (diff)
downloadbcm5719-llvm-f39c2e188d811ede3758eb98aa0201c1c8f978a1.tar.gz
bcm5719-llvm-f39c2e188d811ede3758eb98aa0201c1c8f978a1.zip
Change LaunchThread interface to return an expected.
Change the interface to return an expected, instead of taking a Status pointer. Differential revision: https://reviews.llvm.org/D64163 llvm-svn: 365226
Diffstat (limited to 'lldb/source/Host/common/TaskPool.cpp')
-rw-r--r--lldb/source/Host/common/TaskPool.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/lldb/source/Host/common/TaskPool.cpp b/lldb/source/Host/common/TaskPool.cpp
index dcc4363078d..73f761b5cf6 100644
--- a/lldb/source/Host/common/TaskPool.cpp
+++ b/lldb/source/Host/common/TaskPool.cpp
@@ -8,6 +8,7 @@
#include "lldb/Host/TaskPool.h"
#include "lldb/Host/ThreadLauncher.h"
+#include "lldb/Utility/Log.h"
#include <cstdint>
#include <queue>
@@ -65,9 +66,16 @@ void TaskPoolImpl::AddTask(std::function<void()> &&task_fn) {
// Note that this detach call needs to happen with the m_tasks_mutex held.
// This prevents the thread from exiting prematurely and triggering a linux
// libc bug (https://sourceware.org/bugzilla/show_bug.cgi?id=19951).
- lldb_private::ThreadLauncher::LaunchThread("task-pool.worker", WorkerPtr,
- this, nullptr, min_stack_size)
- .Release();
+ llvm::Expected<HostThread> host_thread =
+ lldb_private::ThreadLauncher::LaunchThread(
+ "task-pool.worker", WorkerPtr, this, min_stack_size);
+ if (host_thread) {
+ host_thread->Release();
+ } else {
+ LLDB_LOG(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_HOST),
+ "failed to launch host thread: {}",
+ llvm::toString(host_thread.takeError()));
+ }
}
}
OpenPOWER on IntegriCloud