Ho un problema di race condition qui:
codice:
bool clusterExists(std::string& infoSet) {
bool exists {false};
#pragma omp critical
exists = mInfoMap.find(infoSet) != mInfoMap.end();
return exists;
}
InfoSet* get(std::string& infoSet, const int& numActs, Env::History& actions) {
if (numActs > 0 && mCreateNotExists && !clusterExists(infoSet)) {
#pragma omp critical
{
mInfoMap.insert({infoSet, new InfoSet {numActs}});
for (auto& a : actions) {
mInfoMap[infoSet]->insertActStr(Env::ActToStr(std::get<1>(a)), std::get<2>(a));
}
}
}
return mInfoMap[infoSet];
}
Penso che il problema sia su "mInfoMap.insert({infoSet, new InfoSet {numActs}});"
Ma non ne sono certo.
Dove sbaglio?