teemperor created this revision. teemperor added a reviewer: LLDB. teemperor requested review of this revision. Herald added a project: LLDB. Herald added a subscriber: lldb-commits.
SBHostOS implements a threading framework that allows creating and manipulating OS threads in the current process. We usually don't deprecate SB APIs, but in this case I think it makes sense because: - The framework is not implemented on all platforms (i.e. Windows and *BSD support seems to be incomplete) - `ThreadCreated` is completely unimplemented.. - It hasn't been touched since the original check-in of the source code. - I don't think it can even be used via the Python bindings as `ThreadCreate` seems impossible to call (it takes a function pointer and returns a OS specific struct). - It's not tested. - It's to my knowledge not used by Xcode or anyone that has their source code indexed by Google. - It's the only reason why we (partially) implement a bunch of internal threading utilities in LLDB (which I'll remove in a follow-up patch). I would propose deprecating it with the upcoming LLDB 13 release (which will be branched in about a month). Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D104231 Files: lldb/bindings/interface/SBHostOS.i lldb/include/lldb/API/SBHostOS.h Index: lldb/include/lldb/API/SBHostOS.h =================================================================== --- lldb/include/lldb/API/SBHostOS.h +++ lldb/include/lldb/API/SBHostOS.h @@ -24,15 +24,21 @@ static lldb::SBFileSpec GetUserHomeDirectory(); - static void ThreadCreated(const char *name); + /// \deprecated Deprecated since LLDB version 13. + static void ThreadCreated(const char *name) LLDB_API_IMPL_DEPRECATED; + /// \deprecated Deprecated since LLDB version 13. static lldb::thread_t ThreadCreate(const char *name, lldb::thread_func_t thread_function, void *thread_arg, lldb::SBError *err); + /// \deprecated Deprecated since LLDB version 13. static bool ThreadCancel(lldb::thread_t thread, lldb::SBError *err); + /// \deprecated Deprecated since LLDB version 13. static bool ThreadDetach(lldb::thread_t thread, lldb::SBError *err); + + /// \deprecated Deprecated since LLDB version 13. static bool ThreadJoin(lldb::thread_t thread, lldb::thread_result_t *result, lldb::SBError *err); Index: lldb/bindings/interface/SBHostOS.i =================================================================== --- lldb/bindings/interface/SBHostOS.i +++ lldb/bindings/interface/SBHostOS.i @@ -27,22 +27,29 @@ static lldb::SBFileSpec GetUserHomeDirectory (); + + %feature("docstring", " .. deprecated:: 13 ") ThreadCreated; static void ThreadCreated (const char *name); + %feature("docstring", " .. deprecated:: 13 ") ThreadCreate; static lldb::thread_t ThreadCreate (const char *name, lldb::thread_func_t, void *thread_arg, lldb::SBError *err); + %feature("docstring", " .. deprecated:: 13 ") ThreadCancel; static bool ThreadCancel (lldb::thread_t thread, lldb::SBError *err); + %feature("docstring", " .. deprecated:: 13 ") ThreadDetach; static bool ThreadDetach (lldb::thread_t thread, lldb::SBError *err); + + %feature("docstring", " .. deprecated:: 13 ") ThreadJoin; static bool ThreadJoin (lldb::thread_t thread, lldb::thread_result_t *result,
Index: lldb/include/lldb/API/SBHostOS.h =================================================================== --- lldb/include/lldb/API/SBHostOS.h +++ lldb/include/lldb/API/SBHostOS.h @@ -24,15 +24,21 @@ static lldb::SBFileSpec GetUserHomeDirectory(); - static void ThreadCreated(const char *name); + /// \deprecated Deprecated since LLDB version 13. + static void ThreadCreated(const char *name) LLDB_API_IMPL_DEPRECATED; + /// \deprecated Deprecated since LLDB version 13. static lldb::thread_t ThreadCreate(const char *name, lldb::thread_func_t thread_function, void *thread_arg, lldb::SBError *err); + /// \deprecated Deprecated since LLDB version 13. static bool ThreadCancel(lldb::thread_t thread, lldb::SBError *err); + /// \deprecated Deprecated since LLDB version 13. static bool ThreadDetach(lldb::thread_t thread, lldb::SBError *err); + + /// \deprecated Deprecated since LLDB version 13. static bool ThreadJoin(lldb::thread_t thread, lldb::thread_result_t *result, lldb::SBError *err); Index: lldb/bindings/interface/SBHostOS.i =================================================================== --- lldb/bindings/interface/SBHostOS.i +++ lldb/bindings/interface/SBHostOS.i @@ -27,22 +27,29 @@ static lldb::SBFileSpec GetUserHomeDirectory (); + + %feature("docstring", " .. deprecated:: 13 ") ThreadCreated; static void ThreadCreated (const char *name); + %feature("docstring", " .. deprecated:: 13 ") ThreadCreate; static lldb::thread_t ThreadCreate (const char *name, lldb::thread_func_t, void *thread_arg, lldb::SBError *err); + %feature("docstring", " .. deprecated:: 13 ") ThreadCancel; static bool ThreadCancel (lldb::thread_t thread, lldb::SBError *err); + %feature("docstring", " .. deprecated:: 13 ") ThreadDetach; static bool ThreadDetach (lldb::thread_t thread, lldb::SBError *err); + + %feature("docstring", " .. deprecated:: 13 ") ThreadJoin; static bool ThreadJoin (lldb::thread_t thread, lldb::thread_result_t *result,
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits