Skip to content

Commit

Permalink
data race on wrongMatches
Browse files Browse the repository at this point in the history
  • Loading branch information
mo-xiaoming committed Apr 22, 2022
1 parent 84054ef commit d46b381
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/Matching.C
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ TEST(Matching, noRaceInterpMatch) {
"| \"foo\" -> 0\n"
"| \"bar\" -> 1\n"
"| _ -> 2");
size_t wrongMatches = 0;
std::atomic_size_t wrongMatches{0U};
std::vector<std::thread> ps;
for (size_t p = 0; p < 10; ++p) {
ps.emplace_back([&]() {
Expand All @@ -407,6 +407,6 @@ TEST(Matching, noRaceInterpMatch) {
for (auto &p : ps) {
p.join();
}
EXPECT_EQ(wrongMatches, size_t(0));
EXPECT_EQ(wrongMatches.load(), size_t(0));
c().buildInterpretedMatches(false);
}

0 comments on commit d46b381

Please sign in to comment.