Keep the list of scheduled events on the timer
Instead of searching for the events to purge, keep the list of scheduled events on the timer list and purge the events that we have scheduled.
This commit is contained in:
@@ -91,9 +91,7 @@
|
||||
|
||||
typedef isc_event_t isc_appevent_t;
|
||||
|
||||
#define ISC_APPEVENT_FIRSTEVENT (ISC_EVENTCLASS_APP + 0)
|
||||
#define ISC_APPEVENT_SHUTDOWN (ISC_EVENTCLASS_APP + 1)
|
||||
#define ISC_APPEVENT_LASTEVENT (ISC_EVENTCLASS_APP + 65535)
|
||||
#define ISC_APPEVENT_SHUTDOWN (ISC_EVENTCLASS_APP + 0)
|
||||
|
||||
ISC_LANG_BEGINDECLS
|
||||
|
||||
|
||||
@@ -76,9 +76,6 @@ struct isc_event {
|
||||
ISC_EVENT_COMMON(struct isc_event);
|
||||
};
|
||||
|
||||
#define ISC_EVENTTYPE_FIRSTEVENT 0x00000000
|
||||
#define ISC_EVENTTYPE_LASTEVENT 0xffffffff
|
||||
|
||||
#define ISC_EVENT_PTR(p) ((isc_event_t **)(void *)(p))
|
||||
|
||||
ISC_LANG_BEGINDECLS
|
||||
|
||||
@@ -68,10 +68,8 @@
|
||||
#include <isc/stdtime.h>
|
||||
#include <isc/types.h>
|
||||
|
||||
#define ISC_TASKEVENT_FIRSTEVENT (ISC_EVENTCLASS_TASK + 0)
|
||||
#define ISC_TASKEVENT_SHUTDOWN (ISC_EVENTCLASS_TASK + 1)
|
||||
#define ISC_TASKEVENT_TEST (ISC_EVENTCLASS_TASK + 1)
|
||||
#define ISC_TASKEVENT_LASTEVENT (ISC_EVENTCLASS_TASK + 65535)
|
||||
#define ISC_TASKEVENT_SHUTDOWN (ISC_EVENTCLASS_TASK + 0)
|
||||
#define ISC_TASKEVENT_TEST (ISC_EVENTCLASS_TASK + 1)
|
||||
|
||||
/*****
|
||||
***** Tasks.
|
||||
|
||||
@@ -81,15 +81,16 @@ typedef enum {
|
||||
isc_timertype_inactive = 3 /*%< Inactive */
|
||||
} isc_timertype_t;
|
||||
|
||||
typedef struct isc_timerevent {
|
||||
typedef struct isc_timerevent isc_timerevent_t;
|
||||
|
||||
struct isc_timerevent {
|
||||
struct isc_event common;
|
||||
isc_time_t due;
|
||||
} isc_timerevent_t;
|
||||
ISC_LINK(isc_timerevent_t) ev_timerlink;
|
||||
};
|
||||
|
||||
#define ISC_TIMEREVENT_FIRSTEVENT (ISC_EVENTCLASS_TIMER + 0)
|
||||
#define ISC_TIMEREVENT_TICK (ISC_EVENTCLASS_TIMER + 1)
|
||||
#define ISC_TIMEREVENT_ONCE (ISC_EVENTCLASS_TIMER + 2)
|
||||
#define ISC_TIMEREVENT_LASTEVENT (ISC_EVENTCLASS_TIMER + 65535)
|
||||
#define ISC_TIMEREVENT_TICK (ISC_EVENTCLASS_TIMER + 0)
|
||||
#define ISC_TIMEREVENT_ONCE (ISC_EVENTCLASS_TIMER + 1)
|
||||
|
||||
/***
|
||||
*** Timer and Timer Manager Functions
|
||||
|
||||
Reference in New Issue
Block a user