OpenDNSSEC-signer
1.3.15
|
#include "config.h"
#include "scheduler/task.h"
#include "shared/allocator.h"
#include "shared/locks.h"
#include "shared/status.h"
#include <stdio.h>
#include <time.h>
#include <ldns/ldns.h>
Go to the source code of this file.
Data Structures | |
struct | schedule_struct |
Typedefs | |
typedef struct schedule_struct | schedule_type |
Functions | |
schedule_type * | schedule_create (allocator_type *allocator) |
void | schedule_flush (schedule_type *schedule, task_id override) |
task_type * | schedule_lookup_task (schedule_type *schedule, task_type *task) |
ods_status | schedule_task (schedule_type *schedule, task_type *task, int log) |
task_type * | unschedule_task (schedule_type *schedule, task_type *task) |
ods_status | reschedule_task (schedule_type *schedule, task_type *task, task_id what, time_t when) |
task_type * | schedule_pop_task (schedule_type *schedule) |
task_type * | schedule_get_first_task (schedule_type *schedule) |
void | schedule_print (FILE *out, schedule_type *schedule) |
void | schedule_cleanup (schedule_type *schedule) |
typedef struct schedule_struct schedule_type |
Task scheduling. Task schedule.
Definition at line 59 of file schedule.h.
ods_status reschedule_task | ( | schedule_type * | schedule, |
task_type * | task, | ||
task_id | what, | ||
time_t | when | ||
) |
Reschedule task.
[in] | schedule | schedule |
[in] | task | task to delete |
[in] | what | new task |
[in] | when | new time |
Reschedule task.
Definition at line 247 of file schedule.c.
References ODS_STATUS_ASSERT_ERR, schedule_task(), unschedule_task(), task_struct::what, and task_struct::when.
void schedule_cleanup | ( | schedule_type * | schedule) |
Clean up schedule.
[in] | schedule | schedule to be cleaned up |
Clean up schedule.
Definition at line 403 of file schedule.c.
References schedule_struct::allocator, allocator_deallocate(), lock_basic_destroy, ods_log_debug(), schedule_struct::schedule_lock, and schedule_struct::tasks.
Referenced by engine_cleanup().
schedule_type* schedule_create | ( | allocator_type * | allocator) |
Create new schedule.
[in] | allocator | memory allocator |
Create new schedule.
Definition at line 51 of file schedule.c.
References schedule_struct::allocator, allocator_alloc(), schedule_struct::flushcount, schedule_struct::loading, lock_basic_init, ods_log_assert, ods_log_error(), schedule_struct::schedule_lock, schedule_struct::schedule_locked, task_compare(), and schedule_struct::tasks.
void schedule_flush | ( | schedule_type * | schedule, |
task_id | override | ||
) |
Flush schedule.
[in] | schedule | schedule to be flushed |
[in] | override | override task |
Flush schedule.
Definition at line 84 of file schedule.c.
References task_struct::flush, schedule_struct::flushcount, ods_log_assert, ods_log_debug(), TASK_NONE, schedule_struct::tasks, and task_struct::what.
task_type* schedule_get_first_task | ( | schedule_type * | schedule) |
Get the first scheduled task.
[in] | schedule | schedule |
Get the first scheduled task.
Definition at line 271 of file schedule.c.
References task_struct::flush, schedule_struct::flushcount, ods_log_assert, ods_log_info(), ods_log_warning(), and schedule_struct::tasks.
Referenced by schedule_pop_task().
task_type* schedule_lookup_task | ( | schedule_type * | schedule, |
task_type * | task | ||
) |
Look up task.
[in] | schedule | schedule |
[in] | task | task |
Look up task.
Definition at line 129 of file schedule.c.
References ods_log_assert, and schedule_struct::tasks.
Referenced by schedule_task().
task_type* schedule_pop_task | ( | schedule_type * | schedule) |
Pop the first scheduled task.
[in] | schedule | schedule |
Pop the first scheduled task.
Definition at line 316 of file schedule.c.
References task_struct::flush, ods_log_assert, ods_log_debug(), ods_log_error(), schedule_get_first_task(), schedule_struct::tasks, time_now(), unschedule_task(), task_struct::when, and task_struct::who.
void schedule_print | ( | FILE * | out, |
schedule_type * | schedule | ||
) |
Print schedule.
[in] | out | file descriptor |
[in] | schedule | schedule |
Print schedule.
Definition at line 355 of file schedule.c.
References ods_log_assert, task_print(), and schedule_struct::tasks.
ods_status schedule_task | ( | schedule_type * | schedule, |
task_type * | task, | ||
int | log | ||
) |
Schedule task.
[in] | schedule | schedule |
[in] | task | task |
[in] | log | add entry in log for this |
Schedule task.
Definition at line 154 of file schedule.c.
References task_struct::flush, schedule_struct::flushcount, ods_log_assert, ods_log_debug(), ods_log_error(), ODS_STATUS_ASSERT_ERR, ODS_STATUS_ERR, ODS_STATUS_OK, schedule_lookup_task(), task_log(), task_what2str(), task_who2str(), schedule_struct::tasks, task_struct::what, and task_struct::who.
Referenced by engine_update_zones(), and reschedule_task().
task_type* unschedule_task | ( | schedule_type * | schedule, |
task_type * | task | ||
) |
Unschedule task.
[in] | schedule | schedule |
[in] | task | task to delete |
Unschedule task.
Definition at line 204 of file schedule.c.
References task_struct::flush, schedule_struct::flushcount, ods_log_assert, ods_log_debug(), ods_log_error(), ods_log_warning(), task_what2str(), task_who2str(), schedule_struct::tasks, task_struct::what, and task_struct::who.
Referenced by engine_update_zones(), reschedule_task(), and schedule_pop_task().