lib: Return 0 as remaining msec if the thread is not scheduled

Signed-off-by: Donatas Abraitis <donatas@opensourcerouting.org>
This commit is contained in:
Donatas Abraitis 2022-07-18 16:28:30 +03:00
parent 5f5b29862f
commit 13bcc010e3

View File

@ -756,6 +756,9 @@ unsigned long thread_timer_remain_msec(struct thread *thread)
{
int64_t remain;
if (!thread_is_scheduled(thread))
return 0;
frr_with_mutex(&thread->mtx) {
remain = monotime_until(&thread->u.sands, NULL) / 1000LL;
}