Skip to content

Commit

Permalink
Avoid deadlock in ConnectionManager::Stop (gazebosim#2950)
Browse files Browse the repository at this point in the history
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>

Co-authored-by: Steve Peters <scpeters@openrobotics.org>
  • Loading branch information
ivanpauno and scpeters committed Apr 14, 2021
1 parent 1102ff2 commit 61265a9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions gazebo/transport/ConnectionManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,9 @@ void ConnectionManager::Fini()
return;

this->Stop();
if (this->initialized)
while (this->stopped == false)
common::Time::MSleep(100);

if (this->masterConn)
{
Expand Down Expand Up @@ -244,10 +247,6 @@ void ConnectionManager::Fini()
void ConnectionManager::Stop()
{
this->stop = true;
this->updateCondition.notify_all();
if (this->initialized)
while (this->stopped == false)
common::Time::MSleep(100);
}

//////////////////////////////////////////////////
Expand Down

0 comments on commit 61265a9

Please sign in to comment.