From 8cb40c91cdfb00ddf04e88d3ecd40403890d90f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Wed, 30 Mar 2016 13:44:03 +0300 Subject: cumulus take-3 --- lib/thread.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/thread.h') diff --git a/lib/thread.h b/lib/thread.h index 5bc756c7..1c9f4f18 100644 --- a/lib/thread.h +++ b/lib/thread.h @@ -84,6 +84,7 @@ struct thread const char *funcname; const char *schedfrom; int schedfrom_line; + unsigned long yield; /* yield time in us */ }; struct cpu_thread_history @@ -108,6 +109,9 @@ enum quagga_clkid { QUAGGA_CLK_REALTIME_STABILISED, /* like realtime, but non-decrementing */ }; +/* Struct timeval's tv_usec one second value. */ +#define TIMER_SECOND_MICRO 1000000L + /* Thread types. */ #define THREAD_READ 0 #define THREAD_WRITE 1 @@ -212,6 +216,8 @@ 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 */ +extern void thread_set_yield_time (struct thread *, unsigned long); /* Internal libzebra exports */ extern void thread_getrusage (RUSAGE_T *); -- cgit v1.2.3