Skip to content

Commit

Permalink
Merge pull request #1660 from mmcgr/prof
Browse files Browse the repository at this point in the history
Protect frequency counter from concurrent modification
  • Loading branch information
mmcgr authored Sep 25, 2020
2 parents 802be19 + fc89db9 commit 447ee26
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/interpreter/InterpreterEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,7 @@ RamDomain InterpreterEngine::execute(const InterpreterNode* node, InterpreterCon
if (profileEnabled && !cur.getProfileText().empty()) {
auto& currentFrequencies = frequencies[cur.getProfileText()];
while (currentFrequencies.size() <= getIterationNumber()) {
#pragma omp critical(frequencies)
currentFrequencies.emplace_back(0);
}
frequencies[cur.getProfileText()][getIterationNumber()]++;
Expand Down

0 comments on commit 447ee26

Please sign in to comment.