[Lldb-commits] [PATCH] D64163: Change LaunchThread interface to return an expected.

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 3 16:16:52 PDT 2019


jingham added inline comments.


================
Comment at: lldb/source/API/SBHostOS.cpp:110-117
+  llvm::Expected<HostThread> thread =
+      ThreadLauncher::LaunchThread(name, thread_function, thread_arg);
+  if (!thread) {
+    llvm::consumeError(thread.takeError());
+    return {};
+  }
+
----------------
If somebody passed you an error_ptr here, you have to fill it in correctly.  The way you've written this, error_ptr won't say Failure() in the case where making the thread fails.


================
Comment at: lldb/source/API/SBHostOS.cpp:114
+    llvm::consumeError(thread.takeError());
+    return {};
+  }
----------------
Does this really end up returning LLDB_INVALID_HOST_THREAD?


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D64163/new/

https://reviews.llvm.org/D64163





More information about the lldb-commits mailing list