forked from OSchip/llvm-project
[clangd] Fix a data race in test code
Found by TSan, thanks bkramer for pointing this out. llvm-svn: 370758
This commit is contained in:
parent
80195e7d1c
commit
72379548eb
|
@ -740,12 +740,14 @@ TEST_F(TUSchedulerTests, CommandLineErrors) {
|
|||
// We should see errors from command-line parsing inside the main file.
|
||||
CDB.ExtraClangFlags = {"-fsome-unknown-flag"};
|
||||
|
||||
// (!) '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) {
|
||||
|
|
Loading…
Reference in New Issue