[PATCH] D42573: [clangd] The new threading implementation

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 6 05:01:01 PST 2018


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

This is really great. Just one test nit.



================
Comment at: unittests/clangd/ThreadingTests.cpp:34
+
+    scheduleIncrements();
+    Tasks.waitForAll();
----------------
The current test passes if `runAsync` is synchronous.
I'd suggest scheduling while holding a mutex that prevents the tasks from getting to the point of incrementing the counter, (and maybe checking that the counter is 0 after scheduling for clarity).


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D42573





More information about the cfe-commits mailing list