diff options
author | Everton Marques <everton.marques@gmail.com> | 2012-02-16 06:14:54 +0100 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2012-02-16 06:17:11 +0100 |
commit | e854095932260b3e6187902aa9a7baa0e96b9428 (patch) | |
tree | 1ee0afa3ad43b610d52bc04f86ea6e2b2e4ad00d /lib | |
parent | e6b03b77766dce8009ad7b4a2392e14addf4ab0f (diff) |
lib: add THREAD_TIMER_MSEC_ON()
* 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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/thread.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/thread.h b/lib/thread.h index 978aa6b0..69bb8d6c 100644 --- a/lib/thread.h +++ b/lib/thread.h @@ -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) \ |