OpenDNSSEC-signer
1.4.8.2
|
#include "daemon/engine.h"
#include "daemon/worker.h"
#include "shared/allocator.h"
#include "shared/duration.h"
#include "shared/hsm.h"
#include "shared/locks.h"
#include "shared/log.h"
#include "shared/status.h"
#include "signer/tools.h"
#include "signer/zone.h"
#include <time.h>
Go to the source code of this file.
Functions | |
worker_type * | worker_create (allocator_type *allocator, int num, worker_id type) |
void | worker_start (worker_type *worker) |
void | worker_sleep (worker_type *worker, time_t timeout) |
void | worker_sleep_unless (worker_type *worker, time_t timeout) |
void | worker_wakeup (worker_type *worker) |
void | worker_wait_timeout (lock_basic_type *lock, cond_basic_type *condition, time_t timeout) |
void | worker_wait (lock_basic_type *lock, cond_basic_type *condition) |
void | worker_notify (lock_basic_type *lock, cond_basic_type *condition) |
void | worker_notify_all (lock_basic_type *lock, cond_basic_type *condition) |
void | worker_cleanup (worker_type *worker) |
Variables | |
ods_lookup_table | worker_str [] |
void worker_cleanup | ( | worker_type * | worker | ) |
Clean up worker.
Definition at line 898 of file worker.c.
References worker_struct::allocator, allocator_deallocate(), lock_basic_destroy, lock_basic_off, worker_struct::worker_alarm, and worker_struct::worker_lock.
Referenced by engine_cleanup().
worker_type* worker_create | ( | allocator_type * | allocator, |
int | num, | ||
worker_id | type | ||
) |
Create worker.
Definition at line 72 of file worker.c.
References worker_struct::allocator, allocator_alloc(), zone_struct::apex, task_struct::backoff, worker_struct::clock_in, zone_struct::db, domain_struct::denial, namedb_struct::domains, duration2time(), worker_struct::engine, fifoq_pop(), fifoq_push(), task_struct::halted, task_struct::halted_when, task_struct::interrupt, namedb_struct::is_processed, worker_struct::jobs_appointed, worker_struct::jobs_completed, worker_struct::jobs_failed, signconf_struct::last_modified, lhsm_check_connection(), schedule_struct::loading, lock_basic_alarm, lock_basic_init, lock_basic_lock, lock_basic_set, lock_basic_sleep, lock_basic_unlock, zone_struct::name, worker_struct::need_to_exit, engine_struct::need_to_reload, rrset_struct::next, ods_log_assert, ods_log_crit(), ods_log_debug(), ods_log_deeebug(), ods_log_error(), ods_log_info(), ods_log_verbose(), ods_log_warning(), ods_status2str(), ODS_STATUS_ERR, ODS_STATUS_OK, ODS_STATUS_UNCHANGED, ODS_STATUS_XFR_NOT_READY, fifoq_struct::q_lock, fifoq_struct::q_nonfull, fifoq_struct::q_threshold, denial_struct::rrset, rrset_sign(), domain_struct::rrsets, schedule_get_first_task(), schedule_struct::schedule_lock, schedule_pop_task(), schedule_task(), stats_struct::sig_count, signconf_struct::sig_resign_interval, stats_struct::sig_reuse, stats_struct::sig_soa_count, stats_struct::sig_time, engine_struct::signal_cond, engine_struct::signal_lock, zone_struct::signconf, engine_struct::signq, worker_struct::sleeping, stats_struct::start_time, zone_struct::stats, stats_struct::stats_lock, worker_struct::task, zone_struct::task, TASK_NONE, TASK_READ, TASK_SIGN, TASK_SIGNCONF, task_what2str(), task_who2str(), TASK_WRITE, engine_struct::taskq, worker_struct::thread_num, time_now(), tools_input(), tools_output(), tools_signconf(), worker_struct::type, worker_struct::waiting, task_struct::what, task_struct::when, worker_struct::worker_alarm, WORKER_DRUDGER, worker_struct::worker_lock, worker_sleep(), worker_sleep_unless(), worker_wakeup(), WORKER_WORKER, worker_struct::working_with, task_struct::zone, zone_backup2(), zone_struct::zone_lock, zone_prepare_keys(), and zone_update_serial().
void worker_notify | ( | lock_basic_type * | lock, |
cond_basic_type * | condition | ||
) |
Notify a worker.
Definition at line 870 of file worker.c.
References lock_basic_alarm, lock_basic_lock, and lock_basic_unlock.
void worker_notify_all | ( | lock_basic_type * | lock, |
cond_basic_type * | condition | ||
) |
Notify all workers.
Definition at line 884 of file worker.c.
References lock_basic_broadcast, lock_basic_lock, and lock_basic_unlock.
Referenced by engine_start_drudgers(), and engine_stop_drudgers().
void worker_sleep | ( | worker_type * | worker, |
time_t | timeout | ||
) |
Put worker to sleep.
Definition at line 781 of file worker.c.
References lock_basic_lock, lock_basic_sleep, lock_basic_unlock, worker_struct::need_to_exit, ods_log_assert, worker_struct::sleeping, worker_struct::worker_alarm, and worker_struct::worker_lock.
Referenced by worker_create().
void worker_sleep_unless | ( | worker_type * | worker, |
time_t | timeout | ||
) |
Put worker to sleep unless worker has measured up to all appointed jobs.
Definition at line 800 of file worker.c.
References worker_struct::jobs_appointed, worker_struct::jobs_completed, worker_struct::jobs_failed, lock_basic_lock, lock_basic_sleep, lock_basic_unlock, worker_struct::need_to_exit, ods_log_assert, ods_log_debug(), worker_struct::sleeping, worker_struct::thread_num, worker_struct::type, worker_struct::worker_alarm, and worker_struct::worker_lock.
Referenced by worker_create().
void worker_start | ( | worker_type * | worker | ) |
Start worker.
Definition at line 758 of file worker.c.
References ods_log_assert, ods_log_error(), worker_struct::type, WORKER_DRUDGER, and WORKER_WORKER.
void worker_wait | ( | lock_basic_type * | lock, |
cond_basic_type * | condition | ||
) |
void worker_wait_timeout | ( | lock_basic_type * | lock, |
cond_basic_type * | condition, | ||
time_t | timeout | ||
) |
Worker waiting.
Definition at line 843 of file worker.c.
References lock_basic_lock, lock_basic_sleep, and lock_basic_unlock.
Referenced by worker_wait().
void worker_wakeup | ( | worker_type * | worker | ) |
Wake up worker.
Definition at line 823 of file worker.c.
References lock_basic_alarm, lock_basic_lock, lock_basic_unlock, ods_log_assert, ods_log_debug(), worker_struct::sleeping, worker_struct::thread_num, worker_struct::type, worker_struct::waiting, worker_struct::worker_alarm, and worker_struct::worker_lock.
Referenced by engine_start_drudgers(), engine_wakeup_workers(), and worker_create().
ods_lookup_table worker_str[] |
The hard workers.