timer-queue: delete next timer event when it got fired

When we fire the timer event, mark the next timeout as NULL because
nothing else is going to timeout anymore until we rearm the timer.

This has the effect that if we cancel and add the same timer from the
callback that we will reprogram the timer with the new timeout instead
of thinking the item as already programmed.
This commit is contained in:
Wim Taymans 2025-09-26 13:02:53 +02:00 committed by Arun Raghavan
parent cf0de8f86d
commit 181269cafc

View file

@ -58,6 +58,7 @@ static void timer_timeout(void *user_data, uint64_t expirations)
pw_log_debug("%p: timer was rearmed", queue);
return;
}
queue->next_timeout = NULL;
pw_log_debug("%p: processing timer %p", queue, timer);
timer->queue = NULL;