[PATCH] D51103: [Support] Add a way to run a function on a detached thread

Dmitry via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 27 09:14:11 PDT 2018


Dmitry.Kozhevnikov added inline comments.


================
Comment at: include/llvm/Support/Threading.h:53
 
 /// llvm_execute_on_thread - Execute the given \p UserFn on a separate
 /// thread, passing it the provided \p UserData and waits for thread
----------------
jfb wrote:
> Dmitry.Kozhevnikov wrote:
> > jfb wrote:
> > > Can you remove the `llvm_execute_on_thread` while you're here?
> > Should I? It's used twice: at `CrashRecoveryContext::RunSafelyOnThread`, and, which is probably worse, exposed via the libclang (tools/clang/include/clang-c/Index.h, `clang_executeOnThread`). My understanding was this API is meant to be stable? That was one of the reasons I haven't touched its interface at all.
> > 
> > Also, while looking for this, I've found the fallback implementation of `llvm_execute_on_thread`, in `lib/Support/Threading.cpp`, which just runs the callback synchronously. Sorry, I haven't updated its signature, will do. I've probably should also add the new function there, that would just raise a fatal error since it's meaningless to call it with multithreading disabled.
> I mean the comment start. Documentation like this is the old LLVM style, and as we update code we also update the docs:
> 
> http://www.llvm.org/docs/CodingStandards.html#doxygen-use-in-documentation-comments
I see, thank you for the info, will do.


https://reviews.llvm.org/D51103





More information about the llvm-commits mailing list