[PATCH] D38032: [clangd] Serialize onDiagnosticsReady callbacks for the same file.

Manuel Klimek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 20 04:48:25 PDT 2017


klimek accepted this revision.
klimek added a comment.
This revision is now accepted and ready to land.

LG



================
Comment at: clangd/ClangdServer.h:287
+  std::mutex DiagnosticsMutex;
+  llvm::StringMap<DocVersion> ReportedDiagnosticVersions;
 };
----------------
Comment what it maps from.


================
Comment at: unittests/clangd/ClangdTests.cpp:912
+        StartSecondReparse.set_value();
+        // Sleep long enough for the second request to be processed.
+        std::this_thread::sleep_for(std::chrono::milliseconds(50));
----------------
ilya-biryukov wrote:
> klimek wrote:
> > Why not hand in a signal to wait for?
> The signal should be fired on a second call to `onDiagnosticsReady`, but the second call won't happen before the fist one returns.
> Is there some other way to fire the signal that I'm missing?
Thinking a bit more about it, I can't find a better way.


https://reviews.llvm.org/D38032





More information about the cfe-commits mailing list