[clang-tools-extra] 6b15a3d - [clangd] TUScheduler::run() (i.e. workspace/symbol) counts towards concurrent threads

Sam McCall via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 3 02:32:51 PST 2020


Author: Sam McCall
Date: 2020-02-03T11:32:33+01:00
New Revision: 6b15a3d722a98c8c4f99ac45cae118e4af9244af

URL: https://github.com/llvm/llvm-project/commit/6b15a3d722a98c8c4f99ac45cae118e4af9244af
DIFF: https://github.com/llvm/llvm-project/commit/6b15a3d722a98c8c4f99ac45cae118e4af9244af.diff

LOG: [clangd] TUScheduler::run() (i.e. workspace/symbol) counts towards concurrent threads

This seems to just be an oversight.

Added: 
    

Modified: 
    clang-tools-extra/clangd/TUScheduler.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clangd/TUScheduler.cpp b/clang-tools-extra/clangd/TUScheduler.cpp
index 69dec9b677fb..9218ae9a03ce 100644
--- a/clang-tools-extra/clangd/TUScheduler.cpp
+++ b/clang-tools-extra/clangd/TUScheduler.cpp
@@ -929,8 +929,9 @@ void TUScheduler::run(llvm::StringRef Name,
                       llvm::unique_function<void()> Action) {
   if (!PreambleTasks)
     return Action();
-  PreambleTasks->runAsync(Name, [Ctx = Context::current().clone(),
+  PreambleTasks->runAsync(Name, [this, Ctx = Context::current().clone(),
                                  Action = std::move(Action)]() mutable {
+    std::lock_guard<Semaphore> BarrierLock(Barrier);
     WithContext WC(std::move(Ctx));
     Action();
   });


        


More information about the cfe-commits mailing list