Fix bug in starting a timer. (#487)

This fixes an issue where calling Start() on a running timer could
lead to out-of-order timers.  This fix always removes the timer from
the list then adds it back after the timer values have been updated.
This commit is contained in:
Jonathan Hui
2016-08-29 11:34:15 -07:00
committed by GitHub
parent 8beb042328
commit 1bb82c54ec
+1 -4
View File
@@ -42,7 +42,7 @@ static Timer *sTail = NULL;
void TimerScheduler::Add(Timer &aTimer)
{
VerifyOrExit(aTimer.mNext == NULL && sTail != &aTimer, ;);
Remove(aTimer);
if (sHead == NULL)
{
@@ -83,9 +83,6 @@ void TimerScheduler::Add(Timer &aTimer)
sTail = &aTimer;
}
}
exit:
return;
}
void TimerScheduler::Remove(Timer &aTimer)