Skip to content

Commit 69fdbdc

Browse files
committed
[lldb] Remove support for SBHostOS threading functionality
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
1 parent f1561b5 commit 69fdbdc

File tree

2 files changed

+7
-42
lines changed

2 files changed

+7
-42
lines changed

lldb/source/API/SBHostOS.cpp

Lines changed: 4 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -101,61 +101,23 @@ lldb::thread_t SBHostOS::ThreadCreate(const char *name,
101101
lldb::thread_func_t thread_function,
102102
void *thread_arg, SBError *error_ptr) {
103103
LLDB_INSTRUMENT_VA(name, thread_function, thread_arg, error_ptr);
104-
llvm::Expected<HostThread> thread =
105-
ThreadLauncher::LaunchThread(name, [thread_function, thread_arg] {
106-
return thread_function(thread_arg);
107-
});
108-
if (!thread) {
109-
if (error_ptr)
110-
error_ptr->SetError(Status(thread.takeError()));
111-
else
112-
llvm::consumeError(thread.takeError());
113-
return LLDB_INVALID_HOST_THREAD;
114-
}
115-
116-
return thread->Release();
104+
return LLDB_INVALID_HOST_THREAD;
117105
}
118106

119107
void SBHostOS::ThreadCreated(const char *name) { LLDB_INSTRUMENT_VA(name); }
120108

121109
bool SBHostOS::ThreadCancel(lldb::thread_t thread, SBError *error_ptr) {
122110
LLDB_INSTRUMENT_VA(thread, error_ptr);
123-
124-
Status error;
125-
HostThread host_thread(thread);
126-
error = host_thread.Cancel();
127-
if (error_ptr)
128-
error_ptr->SetError(error);
129-
host_thread.Release();
130-
return error.Success();
111+
return false;
131112
}
132113

133114
bool SBHostOS::ThreadDetach(lldb::thread_t thread, SBError *error_ptr) {
134115
LLDB_INSTRUMENT_VA(thread, error_ptr);
135-
136-
Status error;
137-
#if defined(_WIN32)
138-
if (error_ptr)
139-
error_ptr->SetErrorString("ThreadDetach is not supported on this platform");
140-
#else
141-
HostThread host_thread(thread);
142-
error = host_thread.GetNativeThread().Detach();
143-
if (error_ptr)
144-
error_ptr->SetError(error);
145-
host_thread.Release();
146-
#endif
147-
return error.Success();
116+
return false;
148117
}
149118

150119
bool SBHostOS::ThreadJoin(lldb::thread_t thread, lldb::thread_result_t *result,
151120
SBError *error_ptr) {
152121
LLDB_INSTRUMENT_VA(thread, result, error_ptr);
153-
154-
Status error;
155-
HostThread host_thread(thread);
156-
error = host_thread.Join(result);
157-
if (error_ptr)
158-
error_ptr->SetError(error);
159-
host_thread.Release();
160-
return error.Success();
122+
return false;
161123
}

llvm/docs/ReleaseNotes.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,9 @@ Changes to the LLVM tools
151151
Changes to LLDB
152152
---------------------------------
153153

154+
* Methods in SBHostOS related to threads have had their implementations
155+
removed. These methods will return a value indicating failure.
156+
154157
Changes to Sanitizers
155158
---------------------
156159
* HWASan now defaults to detecting use-after-scope bugs.

0 commit comments

Comments
 (0)