OpenDNSSEC-signer 1.2.1
|
#include "config.h"
#include "util/log.h"
#include <errno.h>
#include <stdlib.h>
Go to the source code of this file.
Defines | |
#define | LOCKRET(func) |
#define | PTHREADS_DISABLED 1 |
#define | lock_basic_init(lock) |
#define | lock_basic_destroy(lock) |
#define | lock_basic_lock(lock) |
#define | lock_basic_unlock(lock) |
#define | lock_basic_set(cond) |
#define | lock_basic_sleep(cond, lock, sleep) |
#define | lock_basic_alarm(cond) |
#define | lock_basic_off(cond) |
#define | se_thread_create(thr, func, arg) se_thr_fork_create(thr, func, arg) |
#define | se_thread_detach(thr) |
#define | se_thread_self() getpid() |
#define | se_thread_join(thr) se_thr_fork_wait(thr) |
Typedefs | |
typedef int | lock_basic_type |
typedef pid_t | se_thread_type |
Functions | |
void | se_thr_fork_create (se_thread_type *thr, void *(*func)(void *), void *arg) |
void | se_thr_fork_wait (se_thread_type thread) |
void | se_thread_blocksigs (void) |
#define lock_basic_alarm | ( | cond | ) |
Definition at line 97 of file locks.h.
Referenced by signal_handler(), worker_notify(), and worker_wakeup().
#define lock_basic_destroy | ( | lock | ) |
Definition at line 91 of file locks.h.
Referenced by engine_cleanup(), tasklist_cleanup(), worker_cleanup(), and zone_cleanup().
#define lock_basic_init | ( | lock | ) |
Definition at line 90 of file locks.h.
Referenced by engine_create(), tasklist_create(), worker_create(), and zone_create().
#define lock_basic_lock | ( | lock | ) |
Definition at line 92 of file locks.h.
Referenced by engine_update_zones(), signal_handler(), tasklist_create(), worker_create(), worker_notify(), worker_sleep(), worker_start(), worker_wait(), worker_wakeup(), zonelist_lock(), and zonelist_merge().
#define lock_basic_off | ( | cond | ) |
Definition at line 98 of file locks.h.
Referenced by engine_cleanup(), and worker_cleanup().
#define lock_basic_set | ( | cond | ) |
Definition at line 95 of file locks.h.
Referenced by engine_create(), and worker_create().
#define lock_basic_sleep | ( | cond, | |
lock, | |||
sleep | |||
) |
Definition at line 96 of file locks.h.
Referenced by worker_sleep(), and worker_wait().
#define lock_basic_unlock | ( | lock | ) |
Definition at line 93 of file locks.h.
Referenced by engine_update_zones(), signal_handler(), tasklist_create(), worker_create(), worker_notify(), worker_sleep(), worker_start(), worker_wait(), worker_wakeup(), zonelist_unlock(), and zonelist_update().
#define LOCKRET | ( | func | ) |
do { \ int err; \ if ( (err=(func)) != 0) \ se_log_error("%s at %d could not " #func ": %s", \ __FILE__, __LINE__, strerror(err)); \ } while(0)
Threading and locking.
#define se_thread_create | ( | thr, | |
func, | |||
arg | |||
) | se_thr_fork_create(thr, func, arg) |
Definition at line 101 of file locks.h.
Referenced by cmdhandler_start().
#define se_thread_detach | ( | thr | ) |
Definition at line 102 of file locks.h.
Referenced by cmdhandler_start().
typedef int lock_basic_type |
typedef pid_t se_thread_type |
void se_thr_fork_create | ( | se_thread_type * | thr, |
void *(*)(void *) | func, | ||
void * | arg | ||
) |
Threading and locking. No threading available: fork a new process. This means no shared data structure, and no locking. Only the main thread ever returns. Exits on errors.
thr,: | the location where to store the thread-id. |
func,: | function body of the thread. Return value of func is lost. |
arg,: | user argument to func. |
Definition at line 63 of file locks.c.
References se_fatal_exit().
void se_thr_fork_wait | ( | se_thread_type | thread | ) |
There is no threading. Wait for a process to terminate. Note that ub_thread_t is defined as pid_t.
thread,: | the process id to wait for. |
Definition at line 86 of file locks.c.
References se_log_error(), and se_log_warning().
void se_thread_blocksigs | ( | void | ) |
Definition at line 141 of file locks.c.
References se_fatal_exit().