ioeric accepted this revision.
ioeric added inline comments.
This revision is now accepted and ready to land.


================
Comment at: clangd/index/Background.cpp:51
+      std::unique_lock<std::mutex> Lock(QueueMu);
+      assert(!HasActiveTask);
+      QueueCV.wait(Lock, [&] { return ShouldStop || !Queue.empty(); });
----------------
Maybe generalize this to `NumActiveTasks`? Currently, this is single-threaded 
and safe, but it could be missed when we add more threads.


================
Comment at: unittests/clangd/BackgroundIndexTests.cpp:14
+
+TEST(BackgroundIndexTest, IndexesOneFile) {
+  MockFSProvider FS;
----------------
Also add a test for `enqueueAll` with multiple TUs ?


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D53032



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to