[PATCH] D42174: [clangd] Refactored threading in ClangdServer
Sam McCall via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Jan 30 23:21:34 PST 2018
sammccall accepted this revision.
sammccall added a comment.
This revision is now accepted and ready to land.
Ship it!
================
Comment at: clangd/ClangdServer.cpp:37
+template <class Ret, class Func>
+Ret waitForASTAction(Scheduler &S, PathRef File, Func &&F) {
+ std::packaged_task<Ret(llvm::Expected<ParsedAST &>)> Task(
----------------
sammccall wrote:
> Would be nice to have parallel names to the Scheduler methods, e.g. blockingASTRead() and blockingPreambleRead()
Nit: these names got out of sync again
================
Comment at: clangd/TUScheduler.h:23
+/// synchronously).
+unsigned getDefaultAsyncThreadsCount();
+
----------------
just use llvm::hardware_concurrency()?
================
Comment at: clangd/Threading.h:30
+ ThreadPool(unsigned AsyncThreadsCount);
+ ~ThreadPool();
+
----------------
add a comment to the destructor saying what it blocks on?
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D42174
More information about the cfe-commits
mailing list