summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/common/TaskPool.cpp
diff options
context:
space:
mode:
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