[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:30:30 PDT 2023


bulbazord updated this revision to Diff 547290.
bulbazord added a comment.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Updating release notes.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157122

Files:
  lldb/source/API/SBHostOS.cpp
  llvm/docs/ReleaseNotes.rst


Index: llvm/docs/ReleaseNotes.rst
===================================================================
--- llvm/docs/ReleaseNotes.rst
+++ llvm/docs/ReleaseNotes.rst
@@ -147,6 +147,10 @@
 * AArch64 Linux targets now provide access to the Thread Local Storage
   register ``tpidr``.
 
+* Methods in SBHostOS related to threads have had their implementations
+  removed. These methods will return a value indicating failure.
+  
+
 Changes to Sanitizers
 ---------------------
 * HWASan now defaults to detecting use-after-scope bugs.
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.547290.patch
Type: text/x-patch
Size: 2669 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230804/ec5ee5d7/attachment.bin>


More information about the lldb-commits mailing list