[PATCH] D90595: [clangd] Fix race in background index rebuild, where index could stay stale.

Kadir Cetinkaya via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 3 06:05:39 PST 2020


kadircet added inline comments.


================
Comment at: clang-tools-extra/clangd/unittests/BackgroundIndexTests.cpp:848
+        // The first two times the queue goes idle, add a couple more tasks.
+        // This should caute OnIdle to run again.
+        if (++IdleCount <= 2) {
----------------
s/caute/cause


================
Comment at: clang-tools-extra/clangd/unittests/BackgroundIndexTests.cpp:850
+        if (++IdleCount <= 2) {
+          Q.push(Task);
+          Q.push(Task);
----------------
as discussed offline there are no guarantees on these newly pushed tasks finishing before the `OnIdle`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90595/new/

https://reviews.llvm.org/D90595



More information about the cfe-commits mailing list