mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-24 02:46:05 +00:00
[clangd] Fix a TSAN warning in TUSchedulerTests
llvm-svn: 360336
This commit is contained in:
parent
f45c8b2175
commit
2612bac747
@ -673,10 +673,14 @@ TEST_F(TUSchedulerTests, TUStatus) {
|
||||
AllStatus.push_back(Status);
|
||||
}
|
||||
|
||||
std::vector<TUStatus> AllStatus;
|
||||
std::vector<TUStatus> allStatus() {
|
||||
std::lock_guard<std::mutex> Lock(Mutex);
|
||||
return AllStatus;
|
||||
}
|
||||
|
||||
private:
|
||||
std::mutex Mutex;
|
||||
std::vector<TUStatus> AllStatus;
|
||||
} CaptureTUStatus;
|
||||
MockFSProvider FS;
|
||||
MockCompilationDatabase CDB;
|
||||
@ -693,7 +697,7 @@ TEST_F(TUSchedulerTests, TUStatus) {
|
||||
|
||||
ASSERT_TRUE(Server.blockUntilIdleForTest());
|
||||
|
||||
EXPECT_THAT(CaptureTUStatus.AllStatus,
|
||||
EXPECT_THAT(CaptureTUStatus.allStatus(),
|
||||
ElementsAre(
|
||||
// Statuses of "Update" action.
|
||||
TUState(TUAction::RunningAction, "Update"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user