[PATCH] D50993: [clangd] Increase stack size of the new threads on macOS

Ilya Biryukov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 21 03:52:39 PDT 2018


ilya-biryukov added a comment.

1. Can we put the helper that executes the tasks asynchronously with a stack size into llvm's threading library (i.e. somewhere close to `llvm::execute_on_thread`?) All platform-specific code is already there, we can reuse most of the implementation too.
2. I wonder if we should expose the stack size as an option to clangd?



================
Comment at: clangd/Threading.cpp:57
+template <typename Data>
+static void executeOnThreadAndDetach(UserFnPtr<Data> UserFn, Data UserData) {
+#if !defined(__APPLE__)
----------------
Maybe add a parameter for the stack size to this function? (And document it's only taken into account when pthread-based implementation is used)


================
Comment at: clangd/Threading.cpp:57
+template <typename Data>
+static void executeOnThreadAndDetach(UserFnPtr<Data> UserFn, Data UserData) {
+#if !defined(__APPLE__)
----------------
ilya-biryukov wrote:
> Maybe add a parameter for the stack size to this function? (And document it's only taken into account when pthread-based implementation is used)
Maybe accept a `llvm::unique_function<void()>` instead of `UserFn` and `Data`? This split is clearly implementation detail of pthreads-based solution. `std::thread` does not need it.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D50993





More information about the cfe-commits mailing list