Cancellable timers: sorted_list::remove, timer cancel, replace done flag with timer cancellation

This commit is contained in:
Ian Gulliver
2026-04-11 08:28:32 +09:00
parent 3a3c5873c3
commit e486f6501a
5 changed files with 48 additions and 18 deletions

View File

@@ -17,8 +17,12 @@ void dispatch_init() {
dlog("dispatch_init complete");
}
void dispatch_schedule_ms(uint32_t ms, std::function<void()> fn) {
timers.schedule_ms(ms, std::move(fn));
timer_handle dispatch_schedule_ms(uint32_t ms, std::function<void()> fn) {
return timers.schedule_ms(ms, std::move(fn));
}
bool dispatch_cancel_timer(timer_handle h) {
return timers.cancel(h);
}
[[noreturn]] void dispatch_run(std::span<const handler_entry> handlers) {