]> git.proxmox.com Git - mirror_frr.git/blobdiff - lib/thread.c
zebra, lib: fix the ZEBRA_INTERFACE_VRF_UPDATE zapi message
[mirror_frr.git] / lib / thread.c
index d104c4f5988cb46721f49441f7af21ce64a85333..44c9e2b2f1689d93af58cadd431e4b123fb2709b 100644 (file)
@@ -655,20 +655,26 @@ void thread_master_free(struct thread_master *m)
        XFREE(MTYPE_THREAD_MASTER, m);
 }
 
-/* Return remain time in second. */
-unsigned long thread_timer_remain_second(struct thread *thread)
+/* Return remain time in miliseconds. */
+unsigned long thread_timer_remain_msec(struct thread *thread)
 {
        int64_t remain;
 
        pthread_mutex_lock(&thread->mtx);
        {
-               remain = monotime_until(&thread->u.sands, NULL) / 1000000LL;
+               remain = monotime_until(&thread->u.sands, NULL) / 1000LL;
        }
        pthread_mutex_unlock(&thread->mtx);
 
        return remain < 0 ? 0 : remain;
 }
 
+/* Return remain time in seconds. */
+unsigned long thread_timer_remain_second(struct thread *thread)
+{
+       return thread_timer_remain_msec(thread) / 1000LL;
+}
+
 #define debugargdef  const char *funcname, const char *schedfrom, int fromln
 #define debugargpass funcname, schedfrom, fromln