diff options
Diffstat (limited to 'lib/thread.h')
-rw-r--r-- | lib/thread.h | 6 |
1 files changed, 6 insertions, 0 deletions
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 *); |