Skip to content

Commit

Permalink
[MultiThreading] Replace call to getter to init topology by call to i…
Browse files Browse the repository at this point in the history
…nitContainers
  • Loading branch information
epernod committed Oct 31, 2022
1 parent 0d2ebac commit 5cbfd2c
Showing 1 changed file with 1 addition and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,22 +145,7 @@ void ParallelBVHNarrowPhase::initializeTopology(sofa::core::topology::BaseMeshTo
auto insertionIt = m_initializedTopology.insert(topology);
if (insertionIt.second)
{
// The following calls force the creation of some topology arrays before the concurrent computing.
// Those arrays cannot be created on the fly, in a concurrent environment,
// due to possible race conditions.
// Depending on the scene graph, it is possible that those calls are not enough.
if (topology->getNbPoints())
{
topology->getTrianglesAroundVertex(0);
}
if (topology->getNbTriangles())
{
topology->getEdgesInTriangle(0);
}
if (topology->getNbEdges())
{
topology->getTrianglesAroundEdge(0);
}
topology->initContainers();
}
}

Expand Down

0 comments on commit 5cbfd2c

Please sign in to comment.