Skip to content

Commit 61265a9

Browse files
ivanpaunoscpeters
andcommitted
Avoid deadlock in ConnectionManager::Stop (gazebosim#2950)
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com> Co-authored-by: Steve Peters <scpeters@openrobotics.org>
1 parent 1102ff2 commit 61265a9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

gazebo/transport/ConnectionManager.cc

+3-4
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,9 @@ void ConnectionManager::Fini()
215215
return;
216216

217217
this->Stop();
218+
if (this->initialized)
219+
while (this->stopped == false)
220+
common::Time::MSleep(100);
218221

219222
if (this->masterConn)
220223
{
@@ -244,10 +247,6 @@ void ConnectionManager::Fini()
244247
void ConnectionManager::Stop()
245248
{
246249
this->stop = true;
247-
this->updateCondition.notify_all();
248-
if (this->initialized)
249-
while (this->stopped == false)
250-
common::Time::MSleep(100);
251250
}
252251

253252
//////////////////////////////////////////////////

0 commit comments

Comments
 (0)