fix waitForValid to return once time has been shutdown

This commit is contained in:
Josh Faust 2010-06-14 21:32:56 +00:00
parent 700b225f8d
commit 0e30d5709a
1 changed files with 6 additions and 1 deletions

View File

@ -204,7 +204,7 @@ bool Time::waitForValid()
bool Time::waitForValid(const ros::WallDuration& timeout)
{
ros::WallTime start = ros::WallTime::now();
while (!isValid())
while (!isValid() && !g_stopped)
{
ros::WallDuration(0.01).sleep();
@ -214,6 +214,11 @@ bool Time::waitForValid(const ros::WallDuration& timeout)
}
}
if (g_stopped)
{
return false;
}
return true;
}