[clang-tools-extra] e42bb5e - Reapply [clangd] Fix possible assertion fail in TUScheduler

Sam McCall via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 2 07:32:27 PDT 2021


Author: Sam McCall
Date: 2021-07-02T16:32:13+02:00
New Revision: e42bb5e35a88c6a163934080883d4c5bc1f32cfc

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

LOG: Reapply [clangd] Fix possible assertion fail in TUScheduler

This reverts commit fff966b6855aee6fc0d0d4cd401cdd525a838572.

Seems I managed to delete a critical ! after running the tests :-\

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 09c68a3a250b..700d8264555f 100644
--- a/clang-tools-extra/clangd/TUScheduler.cpp
+++ b/clang-tools-extra/clangd/TUScheduler.cpp
@@ -1380,11 +1380,13 @@ bool ASTWorker::blockUntilIdle(Deadline Timeout) const {
   };
   // Make sure ASTWorker has processed all requests, which might issue new
   // updates to PreamblePeer.
-  WaitUntilASTWorkerIsIdle();
+  if (!WaitUntilASTWorkerIsIdle())
+    return false;
   // Now that ASTWorker processed all requests, ensure PreamblePeer has served
   // all update requests. This might create new PreambleRequests for the
   // ASTWorker.
-  PreamblePeer.blockUntilIdle(Timeout);
+  if (!PreamblePeer.blockUntilIdle(Timeout))
+    return false;
   assert(Requests.empty() &&
          "No new normal tasks can be scheduled concurrently with "
          "blockUntilIdle(): ASTWorker isn't threadsafe");


        


More information about the cfe-commits mailing list