diff options
author | Martin Willi <martin@strongswan.org> | 2009-04-21 15:16:56 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2009-04-21 15:16:56 +0000 |
commit | 6554b5e4128e79f3e8576095c872a896446e20da (patch) | |
tree | 42a2062f25fc32a51b4b69c4be9b3dc8749cc286 /src/charon/processing/scheduler.h | |
parent | 59a4e87db60dd24ff6d6d4875bcbf625c809e993 (diff) | |
download | strongswan-6554b5e4128e79f3e8576095c872a896446e20da.tar.bz2 strongswan-6554b5e4128e79f3e8576095c872a896446e20da.tar.xz |
schedule_job uses seconds to support time values larger than 49 days
added schedule_job_ms for ms resolution events
Diffstat (limited to 'src/charon/processing/scheduler.h')
-rw-r--r-- | src/charon/processing/scheduler.h | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/src/charon/processing/scheduler.h b/src/charon/processing/scheduler.h index 33755385d..b9d6df43c 100644 --- a/src/charon/processing/scheduler.h +++ b/src/charon/processing/scheduler.h @@ -26,6 +26,8 @@ typedef struct scheduler_t scheduler_t; +#include <sys/time.h> + #include <library.h> #include <processing/jobs/job.h> @@ -34,17 +36,31 @@ typedef struct scheduler_t scheduler_t; * * The scheduler stores timed events and passes them to the processor. */ -struct scheduler_t { - +struct scheduler_t { + + /** + * Adds a event to the queue, using a relative time offset in s. + * + * @param job job to schedule + * @param time relative time to schedule job, in s + */ + void (*schedule_job) (scheduler_t *this, job_t *job, u_int32_t s); + /** - * Adds a event to the queue, using a relative time offset. + * Adds a event to the queue, using a relative time offset in ms. * - * Schedules a job for execution using a relative time offset. + * @param job job to schedule + * @param time relative time to schedule job, in ms + */ + void (*schedule_job_ms) (scheduler_t *this, job_t *job, u_int32_t ms); + + /** + * Adds a event to the queue, using an absolut time. * - * @param job job to schedule - * @param time relative to to schedule job (in ms) + * @param job job to schedule + * @param time absolut time to schedule job */ - void (*schedule_job) (scheduler_t *this, job_t *job, u_int32_t time); + void (*schedule_job_tv) (scheduler_t *this, job_t *job, timeval_t tv); /** * Returns number of jobs scheduled. |