Signed-off-by: Christian Franke <[email protected]>
---
 lib/thread.c | 8 ++++++++
 lib/thread.h | 1 +
 2 files changed, 9 insertions(+)

diff --git a/lib/thread.c b/lib/thread.c
index cb51332..5e40261 100644
--- a/lib/thread.c
+++ b/lib/thread.c
@@ -662,6 +662,14 @@ thread_timer_remain_second (struct thread *thread)
     return 0;
 }
 
+struct timeval
+thread_timer_remain(struct thread *thread)
+{
+  quagga_get_relative(NULL);
+
+  return timeval_subtract(thread->u.sands, relative_time);
+}
+
 #define debugargdef  const char *funcname, const char *schedfrom, int fromln
 #define debugargpass funcname, schedfrom, fromln
 
diff --git a/lib/thread.h b/lib/thread.h
index 43ffbf6..5bc756c 100644
--- a/lib/thread.h
+++ b/lib/thread.h
@@ -209,6 +209,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);
 
-- 
2.6.1


_______________________________________________
Quagga-dev mailing list
[email protected]
https://lists.quagga.net/mailman/listinfo/quagga-dev

Reply via email to