You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix timer cancellation to be reliable in LayerImplSelect.
To minimize risk, the changes here keep the "grab all the timers we
should fire, then fire them" setup instead of switching to the "fire
the timers one at a time" approach LayerImplFreeRTOS uses.
The fix consists of the following parts:
1) Store the list of timers to fire in a member, so we can cancel things from
that list as needed.
2) To avoid canceling things scheduled by ScheduleWork, remove the CancelTimer
call in ScheduleWork. This does mean we now allow multiple timers for the
same callback+appState in the timer list, if they were created by
ScheduleWork, but that should be OK, since the only reason that pair needs to
be unique is to allow cancellation and we never want to cancel the things
ScheduleWork schedules. As a followup we should stop using the timer list
for ScheduleWork altogether and use ScheduleLambda like LayerImplFreeRTOS
does, but that involves fixing the unit tests that call ScheduleWork without
actually running the platfor manager event loop and expect it to work
somehow.
TestRead was failing the sanity assert for not losing track of timers
to fire, because it was spinning a nested event loop. The changes to
that test stop it from doing that.
Fixesproject-chip#19387Fixesproject-chip#22160
0 commit comments