mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-02 21:06:01 +00:00
lib: add function to get precise remaining time of timer thread
Signed-off-by: Christian Franke <chris@opensourcerouting.org> Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
f3d2b2813d
commit
6ac446878f
@ -766,6 +766,14 @@ strip_funcname (char *dest, const char *funcname)
|
||||
*e = tmp;
|
||||
}
|
||||
|
||||
struct timeval
|
||||
thread_timer_remain(struct thread *thread)
|
||||
{
|
||||
quagga_get_relative(NULL);
|
||||
|
||||
return timeval_subtract(thread->u.sands, relative_time);
|
||||
}
|
||||
|
||||
/* Get new thread. */
|
||||
static struct thread *
|
||||
thread_get (struct thread_master *m, u_char type,
|
||||
|
@ -235,6 +235,7 @@ extern unsigned int thread_cancel_event (struct thread_master *, void *);
|
||||
extern struct thread *thread_fetch (struct thread_master *, struct thread *);
|
||||
extern void thread_call (struct thread *);
|
||||
extern unsigned long thread_timer_remain_second (struct thread *);
|
||||
extern struct timeval thread_timer_remain(struct thread*);
|
||||
extern int thread_should_yield (struct thread *);
|
||||
extern unsigned long timeval_elapsed (struct timeval a, struct timeval b);
|
||||
/* set yield time for thread */
|
||||
|
Loading…
Reference in New Issue
Block a user