[clang-tools-extra] r372128 - [clangd] Fix another TSAN issue

Benjamin Kramer via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 17 07:56:11 PDT 2019


Author: d0k
Date: Tue Sep 17 07:56:11 2019
New Revision: 372128

URL: http://llvm.org/viewvc/llvm-project?rev=372128&view=rev
Log:
[clangd] Fix another TSAN issue

Modified:
    clang-tools-extra/trunk/clangd/unittests/TUSchedulerTests.cpp

Modified: clang-tools-extra/trunk/clangd/unittests/TUSchedulerTests.cpp
URL: http://llvm.org/viewvc/llvm-project/clang-tools-extra/trunk/clangd/unittests/TUSchedulerTests.cpp?rev=372128&r1=372127&r2=372128&view=diff
==============================================================================
--- clang-tools-extra/trunk/clangd/unittests/TUSchedulerTests.cpp (original)
+++ clang-tools-extra/trunk/clangd/unittests/TUSchedulerTests.cpp Tue Sep 17 07:56:11 2019
@@ -769,12 +769,14 @@ TEST_F(TUSchedulerTests, CommandLineWarn
   // We should not see warnings from command-line parsing.
   CDB.ExtraClangFlags = {"-Wsome-unknown-warning"};
 
+  // (!) 'Ready' must live longer than TUScheduler.
+  Notification Ready;
+
   TUScheduler S(CDB, /*AsyncThreadsCount=*/getDefaultAsyncThreadsCount(),
                 /*StorePreambleInMemory=*/true, /*ASTCallbacks=*/captureDiags(),
                 /*UpdateDebounce=*/std::chrono::steady_clock::duration::zero(),
                 ASTRetentionPolicy());
 
-  Notification Ready;
   std::vector<Diag> Diagnostics;
   updateWithDiags(S, testPath("foo.cpp"), "void test() {}",
                   WantDiagnostics::Yes, [&](std::vector<Diag> D) {




More information about the cfe-commits mailing list