mirror of
https://github.com/apache/nuttx.git
synced 2026-09-08 18:06:33 +00:00
sched/hrtimer: Fix reprogram with wrong expiration when reinserting hrtimer
In hrtimer_start_absolute, when a pending hrtimer is removed (was the head) and reinserted with a later expiration time, the reprogram flag remains true but the hrtimer is no longer the earliest timer in the queue. The old code passed hrtimer->expired to hrtimer_reprogram, which was incorrect. Use hrtimer_get_first()->expired to ensure the hardware timer is reprogrammed with the actual earliest timer's expiration time. Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
This commit is contained in:
parent
b438b7a083
commit
f134a5678d
1 changed files with 1 additions and 1 deletions
|
|
@ -88,7 +88,7 @@ int hrtimer_start_absolute(FAR hrtimer_t *hrtimer, hrtimer_entry_t func,
|
|||
|
||||
if (reprogram)
|
||||
{
|
||||
hrtimer_reprogram(hrtimer->expired);
|
||||
hrtimer_reprogram(hrtimer_get_first()->expired);
|
||||
}
|
||||
|
||||
/* Release the lock and give up the ownership of the hrtimer queue. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue