Apache HTTPD
Classes | Macros | Typedefs | Functions

Classes

struct  ap_LINK_watchdog_need_t
 
struct  ap_LINK_watchdog_init_t
 
struct  ap_LINK_watchdog_exit_t
 
struct  ap_LINK_watchdog_step_t
 

Macros

#define AP_WATCHDOG_SINGLETON   "_singleton_"
 
#define AP_WATCHDOG_DEFAULT   "_default_"
 
#define AP_WD_TM_INTERVAL   APR_TIME_C(1000000) /* 1 second */
 
#define AP_WD_TM_SLICE   APR_TIME_C(100000) /* 100 ms */
 
#define AP_WATCHDOG_STATE_STARTING   1
 
#define AP_WATCHDOG_STATE_RUNNING   2
 
#define AP_WATCHDOG_STATE_STOPPING   3
 
#define AP_WD_DECLARE(type)   type
 
#define AP_WD_DECLARE_NONSTD(type)   type
 
#define AP_WD_DECLARE_DATA
 

Typedefs

typedef struct ap_watchdog_t ap_watchdog_t
 
typedef apr_status_t ap_watchdog_callback_fn_t(int state, void *data, apr_pool_t *pool)
 
typedef apr_status_t() apr_OFN_ap_watchdog_get_instance_t(ap_watchdog_t **watchdog, const char *name, int parent, int singleton, apr_pool_t *p)
 
typedef apr_status_t() apr_OFN_ap_watchdog_register_callback_t(ap_watchdog_t *watchdog, apr_interval_time_t interval, const void *data, ap_watchdog_callback_fn_t *callback)
 
typedef apr_status_t() apr_OFN_ap_watchdog_set_callback_interval_t(ap_watchdog_t *w, apr_interval_time_t interval, const void *data, ap_watchdog_callback_fn_t *callback)
 
typedef int ap_HOOK_watchdog_need_t(server_rec *s, const char *name, int parent, int singleton)
 
typedef struct ap_LINK_watchdog_need_t ap_LINK_watchdog_need_t
 
typedef int ap_HOOK_watchdog_init_t(server_rec *s, const char *name, apr_pool_t *pool)
 
typedef struct ap_LINK_watchdog_init_t ap_LINK_watchdog_init_t
 
typedef int ap_HOOK_watchdog_exit_t(server_rec *s, const char *name, apr_pool_t *pool)
 
typedef struct ap_LINK_watchdog_exit_t ap_LINK_watchdog_exit_t
 
typedef int ap_HOOK_watchdog_step_t(server_rec *s, const char *name, apr_pool_t *pool)
 
typedef struct ap_LINK_watchdog_step_t ap_LINK_watchdog_step_t
 

Functions

void ap_hook_watchdog_need (ap_HOOK_watchdog_need_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
 
int ap_run_watchdog_need (server_rec *s, const char *name, int parent, int singleton)
 
apr_array_header_tap_hook_get_watchdog_need (void)
 
void ap_hook_watchdog_init (ap_HOOK_watchdog_init_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
 
int ap_run_watchdog_init (server_rec *s, const char *name, apr_pool_t *pool)
 
apr_array_header_tap_hook_get_watchdog_init (void)
 
void ap_hook_watchdog_exit (ap_HOOK_watchdog_exit_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
 
int ap_run_watchdog_exit (server_rec *s, const char *name, apr_pool_t *pool)
 
apr_array_header_tap_hook_get_watchdog_exit (void)
 
void ap_hook_watchdog_step (ap_HOOK_watchdog_step_t *pf, const char *const *aszPre, const char *const *aszSucc, int nOrder)
 
int ap_run_watchdog_step (server_rec *s, const char *name, apr_pool_t *pool)
 
apr_array_header_tap_hook_get_watchdog_step (void)
 

Detailed Description

Macro Definition Documentation

◆ AP_WATCHDOG_DEFAULT

#define AP_WATCHDOG_DEFAULT   "_default_"

Default watchdog instance name

Definition at line 62 of file mod_watchdog.h.

◆ AP_WATCHDOG_SINGLETON

#define AP_WATCHDOG_SINGLETON   "_singleton_"

Default singleton watchdog instance name. Singleton watchdog is protected by mutex and guaranteed to be run inside a single child process at any time.

Definition at line 57 of file mod_watchdog.h.

◆ AP_WATCHDOG_STATE_RUNNING

#define AP_WATCHDOG_STATE_RUNNING   2

Definition at line 76 of file mod_watchdog.h.

◆ AP_WATCHDOG_STATE_STARTING

#define AP_WATCHDOG_STATE_STARTING   1

Definition at line 75 of file mod_watchdog.h.

◆ AP_WATCHDOG_STATE_STOPPING

#define AP_WATCHDOG_STATE_STOPPING   3

Definition at line 77 of file mod_watchdog.h.

◆ AP_WD_DECLARE

#define AP_WD_DECLARE (   type)    type

Definition at line 86 of file mod_watchdog.h.

◆ AP_WD_DECLARE_DATA

#define AP_WD_DECLARE_DATA

Definition at line 88 of file mod_watchdog.h.

◆ AP_WD_DECLARE_NONSTD

#define AP_WD_DECLARE_NONSTD (   type)    type

Definition at line 87 of file mod_watchdog.h.

◆ AP_WD_TM_INTERVAL

#define AP_WD_TM_INTERVAL   APR_TIME_C(1000000) /* 1 second */

Default Watchdog interval

Definition at line 67 of file mod_watchdog.h.

◆ AP_WD_TM_SLICE

#define AP_WD_TM_SLICE   APR_TIME_C(100000) /* 100 ms */

Watchdog thread timer resolution

Definition at line 72 of file mod_watchdog.h.

Typedef Documentation

◆ ap_HOOK_watchdog_exit_t

typedef int ap_HOOK_watchdog_exit_t(server_rec *s, const char *name, apr_pool_t *pool)

Watchdog terminate hook. It is called when the watchdog thread is terminated.

Parameters
sThe server record
nameWatchdog name.
poolThe pool used to create the watchdog.

Definition at line 194 of file mod_watchdog.h.

◆ ap_HOOK_watchdog_init_t

typedef int ap_HOOK_watchdog_init_t(server_rec *s, const char *name, apr_pool_t *pool)

Watchdog initialize hook. It is called after the watchdog thread is initialized.

Parameters
sThe server record
nameWatchdog name.
poolThe pool used to create the watchdog.

Definition at line 182 of file mod_watchdog.h.

◆ ap_HOOK_watchdog_need_t

typedef int ap_HOOK_watchdog_need_t(server_rec *s, const char *name, int parent, int singleton)

Watchdog require hook.

Parameters
sThe server record
nameWatchdog name.
parentNon-zero to indicate the parent process watchdog mode.
singletonNon-zero to indicate the singleton watchdog mode.
Returns
OK to enable notifications from this watchdog, DECLINED otherwise.
Remarks
This is called in post config phase for all watchdog instances that have no callbacks registered. Modules using this hook should ensure that their post_config hook is called after watchdog post_config.

Definition at line 169 of file mod_watchdog.h.

◆ ap_HOOK_watchdog_step_t

typedef int ap_HOOK_watchdog_step_t(server_rec *s, const char *name, apr_pool_t *pool)

Fixed interval watchdog hook. It is called regularly on AP_WD_TM_INTERVAL interval.

Parameters
sThe server record
nameWatchdog name.
poolTemporary pool destroyed after the call.

Definition at line 206 of file mod_watchdog.h.

◆ ap_LINK_watchdog_exit_t

◆ ap_LINK_watchdog_init_t

◆ ap_LINK_watchdog_need_t

◆ ap_LINK_watchdog_step_t

◆ ap_watchdog_callback_fn_t

typedef apr_status_t ap_watchdog_callback_fn_t(int state, void *data, apr_pool_t *pool)

Callback function used for watchdog.

Parameters
stateWatchdog state function. See AP_WATCHDOG_STATE_ .
datais what was passed to ap_watchdog_register_callback function.
poolTemporary callback pool destroyed after the call.
Returns
APR_SUCCESS to continue calling this callback.

Definition at line 111 of file mod_watchdog.h.

◆ ap_watchdog_t

Definition at line 79 of file mod_watchdog.h.

◆ apr_OFN_ap_watchdog_get_instance_t

typedef apr_status_t() apr_OFN_ap_watchdog_get_instance_t(ap_watchdog_t **watchdog, const char *name, int parent, int singleton, apr_pool_t *p)

Get watchdog instance.

Parameters
watchdogStorage for watchdog instance.
nameWatchdog name.
parentNon-zero to get the parent process watchdog instance.
singletonNon-zero to get the singleton watchdog instance.
pThe pool to use.
Returns
APR_SUCCESS if all went well
Remarks
Use AP_WATCHDOG_DEFAULT to get default watchdog instance. If separate watchdog thread is needed provide unique name and function will create a new watchdog instance. Note that default client process watchdog works in singleton mode.

Definition at line 129 of file mod_watchdog.h.

◆ apr_OFN_ap_watchdog_register_callback_t

typedef apr_status_t() apr_OFN_ap_watchdog_register_callback_t(ap_watchdog_t *watchdog, apr_interval_time_t interval, const void *data, ap_watchdog_callback_fn_t *callback)

Register watchdog callback.

Parameters
watchdogWatchdog to use
intervalInterval on which the callback function will execute.
callbackThe function to call on watchdog event.
dataThe data to pass to the callback function.
Returns
APR_SUCCESS if all went well. APR_EEXIST if already registered.

Definition at line 141 of file mod_watchdog.h.

◆ apr_OFN_ap_watchdog_set_callback_interval_t

typedef apr_status_t() apr_OFN_ap_watchdog_set_callback_interval_t(ap_watchdog_t *w, apr_interval_time_t interval, const void *data, ap_watchdog_callback_fn_t *callback)

Update registered watchdog callback interval.

Parameters
wWatchdog to use
intervalNew interval on which the callback function will execute.
callbackThe function to call on watchdog event.
dataThe data to pass to the callback function.
Returns
APR_SUCCESS if all went well. APR_EOF if callback was not found.

Definition at line 153 of file mod_watchdog.h.

Function Documentation

◆ ap_hook_get_watchdog_exit()

apr_array_header_t * ap_hook_get_watchdog_exit ( void  )

Definition at line 713 of file mod_watchdog.c.

◆ ap_hook_get_watchdog_init()

apr_array_header_t * ap_hook_get_watchdog_init ( void  )

Definition at line 708 of file mod_watchdog.c.

◆ ap_hook_get_watchdog_need()

apr_array_header_t * ap_hook_get_watchdog_need ( void  )

Definition at line 703 of file mod_watchdog.c.

◆ ap_hook_get_watchdog_step()

apr_array_header_t * ap_hook_get_watchdog_step ( void  )

Definition at line 718 of file mod_watchdog.c.

◆ ap_hook_watchdog_exit()

void ap_hook_watchdog_exit ( ap_HOOK_watchdog_exit_t pf,
const char *const aszPre,
const char *const aszSucc,
int  nOrder 
)

Definition at line 713 of file mod_watchdog.c.

◆ ap_hook_watchdog_init()

void ap_hook_watchdog_init ( ap_HOOK_watchdog_init_t pf,
const char *const aszPre,
const char *const aszSucc,
int  nOrder 
)

Definition at line 708 of file mod_watchdog.c.

◆ ap_hook_watchdog_need()

void ap_hook_watchdog_need ( ap_HOOK_watchdog_need_t pf,
const char *const aszPre,
const char *const aszSucc,
int  nOrder 
)

Definition at line 703 of file mod_watchdog.c.

◆ ap_hook_watchdog_step()

void ap_hook_watchdog_step ( ap_HOOK_watchdog_step_t pf,
const char *const aszPre,
const char *const aszSucc,
int  nOrder 
)

Definition at line 718 of file mod_watchdog.c.

◆ ap_run_watchdog_exit()

int ap_run_watchdog_exit ( server_rec s,
const char name,
apr_pool_t pool 
)

< Module has handled this stage.

< Module has handled this stage.

< Module declines to handle

< Module has handled this stage.

Definition at line 713 of file mod_watchdog.c.

◆ ap_run_watchdog_init()

int ap_run_watchdog_init ( server_rec s,
const char name,
apr_pool_t pool 
)

< Module has handled this stage.

< Module has handled this stage.

< Module declines to handle

< Module has handled this stage.

Definition at line 708 of file mod_watchdog.c.

◆ ap_run_watchdog_need()

int ap_run_watchdog_need ( server_rec s,
const char name,
int  parent,
int  singleton 
)

< Module declines to handle

< Module declines to handle

Definition at line 703 of file mod_watchdog.c.

◆ ap_run_watchdog_step()

int ap_run_watchdog_step ( server_rec s,
const char name,
apr_pool_t pool 
)

< Module has handled this stage.

< Module has handled this stage.

< Module declines to handle

< Module has handled this stage.

Definition at line 718 of file mod_watchdog.c.