Skip to content
Snippets Groups Projects
Commit 9b50e459 authored by Nicolas Marsic's avatar Nicolas Marsic
Browse files

Thread safe BasisFactory::getNodalBasis()

parent 72b930c2
No related branches found
No related tags found
No related merge requests found
......@@ -45,10 +45,17 @@ const nodalBasis* BasisFactory::getNodalBasis(int tag)
return NULL;
}
// FIXME: check if already exists to deallocate if necessary
fs.insert(std::make_pair(tag, F));
std::pair<std::map<int, nodalBasis*>::const_iterator, bool> inserted;
return F;
#pragma omp critical
{
inserted = fs.insert(std::make_pair(tag, F));
if (!inserted.second)
delete F;
}
return inserted.first->second;
}
const JacobianBasis* BasisFactory::getJacobianBasis(int tag)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment