mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 06:43:16 +00:00
lib: add thread_add_timer_tv (struct timeval)
Another zoo extension, this adds a timer scheduling function that takes a struct timeval argument (which is actually what the wrappers boil down to, yet it's not exposed...) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
parent
b21e9619c5
commit
d03c4cbd9a
11
lib/thread.c
11
lib/thread.c
@ -941,6 +941,17 @@ funcname_thread_add_timer_msec (struct thread_master *m,
|
|||||||
arg, &trel, debugargpass);
|
arg, &trel, debugargpass);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Add timer event thread with "millisecond" resolution */
|
||||||
|
struct thread *
|
||||||
|
funcname_thread_add_timer_tv (struct thread_master *m,
|
||||||
|
int (*func) (struct thread *),
|
||||||
|
void *arg, struct timeval *tv,
|
||||||
|
debugargdef)
|
||||||
|
{
|
||||||
|
return funcname_thread_add_timer_timeval (m, func, THREAD_TIMER,
|
||||||
|
arg, tv, debugargpass);
|
||||||
|
}
|
||||||
|
|
||||||
/* Add a background thread, with an optional millisec delay */
|
/* Add a background thread, with an optional millisec delay */
|
||||||
struct thread *
|
struct thread *
|
||||||
funcname_thread_add_background (struct thread_master *m,
|
funcname_thread_add_background (struct thread_master *m,
|
||||||
|
@ -197,6 +197,7 @@ enum quagga_clkid {
|
|||||||
#define thread_add_write(m,f,a,v) funcname_thread_add_read_write(THREAD_WRITE,m,f,a,v,#f,__FILE__,__LINE__)
|
#define thread_add_write(m,f,a,v) funcname_thread_add_read_write(THREAD_WRITE,m,f,a,v,#f,__FILE__,__LINE__)
|
||||||
#define thread_add_timer(m,f,a,v) funcname_thread_add_timer(m,f,a,v,#f,__FILE__,__LINE__)
|
#define thread_add_timer(m,f,a,v) funcname_thread_add_timer(m,f,a,v,#f,__FILE__,__LINE__)
|
||||||
#define thread_add_timer_msec(m,f,a,v) funcname_thread_add_timer_msec(m,f,a,v,#f,__FILE__,__LINE__)
|
#define thread_add_timer_msec(m,f,a,v) funcname_thread_add_timer_msec(m,f,a,v,#f,__FILE__,__LINE__)
|
||||||
|
#define thread_add_timer_tv(m,f,a,v) funcname_thread_add_timer_tv(m,f,a,v,#f,__FILE__,__LINE__)
|
||||||
#define thread_add_event(m,f,a,v) funcname_thread_add_event(m,f,a,v,#f,__FILE__,__LINE__)
|
#define thread_add_event(m,f,a,v) funcname_thread_add_event(m,f,a,v,#f,__FILE__,__LINE__)
|
||||||
#define thread_execute(m,f,a,v) funcname_thread_execute(m,f,a,v,#f,__FILE__,__LINE__)
|
#define thread_execute(m,f,a,v) funcname_thread_execute(m,f,a,v,#f,__FILE__,__LINE__)
|
||||||
|
|
||||||
@ -217,6 +218,10 @@ extern struct thread *funcname_thread_add_timer (struct thread_master *,
|
|||||||
extern struct thread *funcname_thread_add_timer_msec (struct thread_master *,
|
extern struct thread *funcname_thread_add_timer_msec (struct thread_master *,
|
||||||
int (*)(struct thread *),
|
int (*)(struct thread *),
|
||||||
void *, long, debugargdef);
|
void *, long, debugargdef);
|
||||||
|
extern struct thread *funcname_thread_add_timer_tv (struct thread_master *,
|
||||||
|
int (*)(struct thread *),
|
||||||
|
void *, struct timeval *,
|
||||||
|
debugargdef);
|
||||||
extern struct thread *funcname_thread_add_event (struct thread_master *,
|
extern struct thread *funcname_thread_add_event (struct thread_master *,
|
||||||
int (*)(struct thread *),
|
int (*)(struct thread *),
|
||||||
void *, int, debugargdef);
|
void *, int, debugargdef);
|
||||||
|
Loading…
Reference in New Issue
Block a user