[Lldb-commits] [PATCH] D157122: [lldb] Remove support for SBHostOS threading functionality

Alex Langford via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Aug 4 11:20:39 PDT 2023


bulbazord created this revision.
Herald added a project: All.
bulbazord requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

As stated on Discourse*, these methods have been deprecated. I am
removing their implementation. They will now do nothing and return a
value indicating failure (where appropriate).
Due to the LLDB project's commitment to ABI stability at the SB API
layer, we cannot remove these symbols completely.

Discourse link: https://discourse.llvm.org/t/do-you-use-the-threading-functionality-in-sbhostos/71973


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157122

Files:
  lldb/source/API/SBHostOS.cpp


Index: lldb/source/API/SBHostOS.cpp
===================================================================
--- lldb/source/API/SBHostOS.cpp
+++ lldb/source/API/SBHostOS.cpp
@@ -101,61 +101,23 @@
                                       lldb::thread_func_t thread_function,
                                       void *thread_arg, SBError *error_ptr) {
   LLDB_INSTRUMENT_VA(name, thread_function, thread_arg, error_ptr);
-  llvm::Expected<HostThread> thread =
-      ThreadLauncher::LaunchThread(name, [thread_function, thread_arg] {
-        return thread_function(thread_arg);
-      });
-  if (!thread) {
-    if (error_ptr)
-      error_ptr->SetError(Status(thread.takeError()));
-    else
-      llvm::consumeError(thread.takeError());
-    return LLDB_INVALID_HOST_THREAD;
-  }
-
-  return thread->Release();
+  return LLDB_INVALID_HOST_THREAD;
 }
 
 void SBHostOS::ThreadCreated(const char *name) { LLDB_INSTRUMENT_VA(name); }
 
 bool SBHostOS::ThreadCancel(lldb::thread_t thread, SBError *error_ptr) {
   LLDB_INSTRUMENT_VA(thread, error_ptr);
-
-  Status error;
-  HostThread host_thread(thread);
-  error = host_thread.Cancel();
-  if (error_ptr)
-    error_ptr->SetError(error);
-  host_thread.Release();
-  return error.Success();
+  return false;
 }
 
 bool SBHostOS::ThreadDetach(lldb::thread_t thread, SBError *error_ptr) {
   LLDB_INSTRUMENT_VA(thread, error_ptr);
-
-  Status 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();
+  return false;
 }
 
 bool SBHostOS::ThreadJoin(lldb::thread_t thread, lldb::thread_result_t *result,
                           SBError *error_ptr) {
   LLDB_INSTRUMENT_VA(thread, result, error_ptr);
-
-  Status error;
-  HostThread host_thread(thread);
-  error = host_thread.Join(result);
-  if (error_ptr)
-    error_ptr->SetError(error);
-  host_thread.Release();
-  return error.Success();
+  return false;
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157122.547280.patch
Type: text/x-patch
Size: 2138 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230804/199ddc76/attachment.bin>


More information about the lldb-commits mailing list