]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: add THREAD_TIMER_MSEC_ON()
authorEverton Marques <everton.marques@gmail.com>
Thu, 16 Feb 2012 05:14:54 +0000 (06:14 +0100)
committerDavid Lamparter <equinox@diac24.net>
Thu, 16 Feb 2012 05:17:11 +0000 (06:17 +0100)
 * lib/thread.h: new timer macro, millisecond precision

(this was cherrypicked from pimd to isolate all non-contained changes)

From: Everton Marques <everton.marques@gmail.com>
Signed-off-by: David Lamparter <equinox@diac24.net>
lib/thread.h

index 978aa6b0ad4972908f1bdda89b758a5706fd1371..69bb8d6c5e864bf4fd057d945fc2bf75c8942369 100644 (file)
@@ -1,5 +1,6 @@
 /* Thread management routine header.
  * Copyright (C) 1998 Kunihiro Ishiguro
+ * Portions Copyright (c) 2008 Everton da Silva Marques <everton.marques@gmail.com>
  *
  * This file is part of GNU Zebra.
  *
@@ -137,6 +138,12 @@ enum quagga_clkid {
       thread = thread_add_timer (master, func, arg, time); \
   } while (0)
 
+#define THREAD_TIMER_MSEC_ON(master,thread,func,arg,time) \
+  do { \
+    if (! thread) \
+      thread = thread_add_timer_msec (master, func, arg, time); \
+  } while (0)
+
 #define THREAD_OFF(thread) \
   do { \
     if (thread) \