diff options
Diffstat (limited to 'src/common/loop.c')
| -rw-r--r-- | src/common/loop.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/common/loop.c b/src/common/loop.c index 3815e91..a63df16 100644 --- a/src/common/loop.c +++ b/src/common/loop.c @@ -208,6 +208,15 @@ static void timer_cleanup_deleted(struct yasl_loop *l) l->timer_count = dest; } +bool yasl_loop_timer_armed(const struct yasl_loop *l, yasl_timer_id id) +{ + if (!l || id == 0) return false; + for (int i = 0; i < l->timer_count; i++) + if (l->timers[i].id == id) + return !l->timers[i].deleted; + return false; +} + int yasl_loop_next_timeout_ms(const struct yasl_loop *l) { if (!l || l->timer_count <= 0) return -1; |
