summaryrefslogtreecommitdiffstats
path: root/lib/thread.h
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2016-03-30 13:44:03 +0300
committerTimo Teräs <timo.teras@iki.fi>2016-03-30 14:29:40 +0300
commit8cb40c91cdfb00ddf04e88d3ecd40403890d90f7 (patch)
tree6d6a3de27525820abb740f1fa8347b6f03986bad /lib/thread.h
parent86c5d2ee68f7b9c00ae4aeb5c8b3c5d82c5ebffc (diff)
downloadquagga-8cb40c91cdfb00ddf04e88d3ecd40403890d90f7.tar.bz2
quagga-8cb40c91cdfb00ddf04e88d3ecd40403890d90f7.tar.xz
cumulus take-3cumulus-take-3
Diffstat (limited to 'lib/thread.h')
-rw-r--r--lib/thread.h6
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 *);