summaryrefslogtreecommitdiff
path: root/lib/thread.c
diff options
context:
space:
mode:
authorDonald Sharp <donaldsharp72@gmail.com>2022-07-19 12:07:02 -0400
committerGitHub <noreply@github.com>2022-07-19 12:07:02 -0400
commita741212913ecf7cec22d4eb1fff0258510c6ba5a (patch)
tree20a2e5a1671d6777a481f97d70f71c097be4bc1d /lib/thread.c
parentb40a74fc2d73ee8394b7e82c8849b3886f94de2e (diff)
parent1f37d8c2d35cbe4ce347f7b5936d826890e97a8d (diff)
Merge pull request #11637 from opensourcerouting/fix/remaining_sec_for_null
*: thread_timer_remain_second NULL handling
Diffstat (limited to 'lib/thread.c')
-rw-r--r--lib/thread.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/thread.c b/lib/thread.c
index fd79503cc6..9c783808b5 100644
--- a/lib/thread.c
+++ b/lib/thread.c
@@ -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;
}