X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvppinfra%2Ftw_timer_template.c;h=9c9bb977d5e48ec37d59e40f5d43ad53eaea45cb;hb=ef90ed08fbcde7535b4a789349b39dc25798c77d;hp=da40e2c0b3ea8374dc2033ac1969b1cff4e4ad46;hpb=adb5bd5344cd7b422c0c08e6434ad8642b897502;p=vpp.git diff --git a/src/vppinfra/tw_timer_template.c b/src/vppinfra/tw_timer_template.c index da40e2c0b3e..9c9bb977d5e 100644 --- a/src/vppinfra/tw_timer_template.c +++ b/src/vppinfra/tw_timer_template.c @@ -157,7 +157,7 @@ timer_remove (TWT (tw_timer) * pool, TWT (tw_timer) * elt) elt->prev = elt->next = ~0; } -static void +static inline void timer_add (TWT (tw_timer_wheel) * tw, TWT (tw_timer) * t, u64 interval) { #if TW_TIMER_WHEELS > 1 @@ -376,6 +376,11 @@ void TW (tw_timer_stop) (TWT (tw_timer_wheel) * tw, u32 handle) pool_put_index (tw->timers, handle); } +int TW (tw_timer_handle_is_free) (TWT (tw_timer_wheel) * tw, u32 handle) +{ + return pool_is_free_index (tw->timers, handle); +} + /** * @brief Update a tw timer * @param tw_timer_wheel_t * tw timer wheel object pointer