Skip to content
Snippets Groups Projects
Commit 413309ec authored by Riccardo Maria Bianchi's avatar Riccardo Maria Bianchi :sunny:
Browse files

Fix deadlock status by removing a lock in the 'exec'. Needs more work however.

Briefly: I added locks to protect the methods that access the m_daughters std::vector. However, having the lock to protect the .size() call before launching exec() causes a deadlock. I think we should think more thoroughly about the correct way to make this class, and its sibling GeoFullPhysVol, thread-safe.
parent f61b70f0
No related branches found
No related tags found
1 merge request!9Fix friend classes persistification and concurrent access to add() method
...@@ -89,7 +89,9 @@ void GeoPhysVol::exec(GeoNodeAction *action) const ...@@ -89,7 +89,9 @@ void GeoPhysVol::exec(GeoNodeAction *action) const
&& action->getPath()->getLength() > action->getDepthLimit()) { && action->getPath()->getLength() > action->getDepthLimit()) {
} }
else { else {
std::lock_guard<std::mutex> lk(muxVec); // FIXME: m_daughters access is now protected in other methods, but having the lock here makes a deadlock
// std::lock_guard<std::mutex> lk(muxVec);
// TODO: Think more thouroughly about thread-safe of this class...!!
for(size_t c = 0; c < m_daughters.size (); c++) { for(size_t c = 0; c < m_daughters.size (); c++) {
m_daughters[c]->exec(action); m_daughters[c]->exec(action);
if(action->shouldTerminate()) { if(action->shouldTerminate()) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment