Skip to content

Commit

Permalink
Merge pull request #438 from mo-xiaoming/race-matching
Browse files Browse the repository at this point in the history
data race on wrongMatches
  • Loading branch information
dawa79 authored Apr 22, 2022
2 parents 84054ef + d46b381 commit fc1bf3b
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 fc1bf3b

Please sign in to comment.