diff options
author | Chris Hall <chris.hall@highwayman.com> | 2011-09-02 00:53:59 +0100 |
---|---|---|
committer | Chris Hall <chris.hall@highwayman.com> | 2011-09-02 00:53:59 +0100 |
commit | 3690074a486cfada568975e287d9cbb9e687501f (patch) | |
tree | f6394c1ab1ca8381e9a77acca84f03dc701d10b2 /lib/qtimers.h | |
parent | 3f515315d5b17e432453eef67d7ac9e27bc39461 (diff) | |
download | quagga-3690074a486cfada568975e287d9cbb9e687501f.tar.bz2 quagga-3690074a486cfada568975e287d9cbb9e687501f.tar.xz |
Merging of euro_ix branch into pipework.
Bring in fixes for bgp dumping with pthreaded BGP Engine.
Bring in new "show nexus xxx" command.
Fix removal of '~' prompt.
Diffstat (limited to 'lib/qtimers.h')
-rw-r--r-- | lib/qtimers.h | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/lib/qtimers.h b/lib/qtimers.h index 16808f1b..ae0a5c70 100644 --- a/lib/qtimers.h +++ b/lib/qtimers.h @@ -77,12 +77,23 @@ typedef struct qtimer_pile* qtimer_pile ; typedef void (qtimer_action)(qtimer qtr, void* timer_info, qtime_mono_t when) ; +typedef enum +{ + qtrs_inactive = 0, + qtrs_active = 1, + + qtrs_unset_pending = 2, + qtrs_free_pending = 4, + + qtrs_dispatch = 8, +} qtr_state_t ; + struct qtimer { qtimer_pile pile ; /* pile currently allocated to */ heap_backlink_t backlink ; - bool active ; /* true => in the pile */ + qtr_state_t state ; qtime_mono_t time ; /* current time to trigger action */ qtimer_action* action ; @@ -94,8 +105,6 @@ struct qtimer struct qtimer_pile { struct heap timers ; - - qtimer implicit_unset ; /* used during dispatch */ } ; /*============================================================================== @@ -104,7 +113,8 @@ struct qtimer_pile extern qtimer_pile qtimer_pile_init_new(qtimer_pile qtp) ; extern bool qtimer_pile_dispatch_next(qtimer_pile qtp, qtime_mono_t upto) ; -extern qtime_t qtimer_pile_top_wait(qtimer_pile qtp, qtime_t max_wait) ; +extern qtime_t qtimer_pile_top_wait(qtimer_pile qtp, qtime_t max_wait, + qtime_t now) ; extern qtimer qtimer_pile_ream(qtimer_pile qtp, free_keep_b free_structure) ; /* Ream out qtimer pile and free the qtimer structure. */ @@ -200,4 +210,13 @@ qtimer_get_interval(qtimer qtr) return qtr->interval ; } ; +/*------------------------------------------------------------------------------ + * See if given qtimer (if any) is active + */ +Inline bool +qtimer_is_active(qtimer qtr) +{ + return (qtr != NULL) && ((qtr->state & qtrs_active) != 0) ; +} + #endif /* _ZEBRA_QTIMERS_H */ |