Apache HTTPD
mod_watchdog.h
Go to the documentation of this file.
1/* Licensed to the Apache Software Foundation (ASF) under one or more
2 * contributor license agreements. See the NOTICE file distributed with
3 * this work for additional information regarding copyright ownership.
4 * The ASF licenses this file to You under the Apache License, Version 2.0
5 * (the "License"); you may not use this file except in compliance with
6 * the License. You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef MOD_WATCHDOG_H
18#define MOD_WATCHDOG_H
19
29#include "httpd.h"
30#include "http_config.h"
31#include "http_log.h"
32#include "ap_provider.h"
33
34#include "apr.h"
35#include "apr_strings.h"
36#include "apr_pools.h"
37#include "apr_shm.h"
38#include "apr_hash.h"
39#include "apr_hooks.h"
40#include "apr_optional.h"
41#include "apr_file_io.h"
42#include "apr_time.h"
43#include "apr_thread_proc.h"
44#include "apr_global_mutex.h"
45#include "apr_thread_mutex.h"
46
47#ifdef __cplusplus
48extern "C" {
49#endif
50
57#define AP_WATCHDOG_SINGLETON "_singleton_"
58
62#define AP_WATCHDOG_DEFAULT "_default_"
63
67#define AP_WD_TM_INTERVAL APR_TIME_C(1000000) /* 1 second */
68
72#define AP_WD_TM_SLICE APR_TIME_C(100000) /* 100 ms */
73
74/* State values for callback */
75#define AP_WATCHDOG_STATE_STARTING 1
76#define AP_WATCHDOG_STATE_RUNNING 2
77#define AP_WATCHDOG_STATE_STOPPING 3
78
80
81/* Create a set of AP_WD_DECLARE(type), AP_WD_DECLARE_NONSTD(type) and
82 * AP_WD_DECLARE_DATA with appropriate export and import tags for the platform
83 */
84#if !defined(AP_WD_DECLARE)
85#if !defined(WIN32)
86#define AP_WD_DECLARE(type) type
87#define AP_WD_DECLARE_NONSTD(type) type
88#define AP_WD_DECLARE_DATA
89#elif defined(AP_WD_DECLARE_STATIC)
90#define AP_WD_DECLARE(type) type __stdcall
91#define AP_WD_DECLARE_NONSTD(type) type
92#define AP_WD_DECLARE_DATA
93#elif defined(AP_WD_DECLARE_EXPORT)
94#define AP_WD_DECLARE(type) __declspec(dllexport) type __stdcall
95#define AP_WD_DECLARE_NONSTD(type) __declspec(dllexport) type
96#define AP_WD_DECLARE_DATA __declspec(dllexport)
97#else
98#define AP_WD_DECLARE(type) __declspec(dllimport) type __stdcall
99#define AP_WD_DECLARE_NONSTD(type) __declspec(dllimport) type
100#define AP_WD_DECLARE_DATA __declspec(dllimport)
101#endif
102#endif
103
113
128 (ap_watchdog_t **watchdog, const char *name, int parent,
130
142
154
168 const char *name,
169 int parent, int singleton))
170
171
172
180 server_rec *s,
181 const char *name,
183
184
192 server_rec *s,
193 const char *name,
195
196
204 server_rec *s,
205 const char *name,
207
208#ifdef __cplusplus
209}
210#endif
211
212#endif /* MOD_WATCHDOG_H */
Apache Provider API.
APR File I/O Handling.
APR Global Locking Routines.
APR Hash Tables.
Apache hook functions.
APR-UTIL registration of functions exported by modules.
APR memory allocation.
APR Shared Memory Routines.
APR Strings library.
APR Thread Mutex Routines.
APR Thread and Process Library.
APR Time Library.
#define APR_DECLARE_EXTERNAL_HOOK(ns, link, ret, name, args)
Definition apr_hooks.h:118
#define APR_DECLARE_OPTIONAL_FN(ret, name, args)
apr_status_t ap_watchdog_callback_fn_t(int state, void *data, apr_pool_t *pool)
apr_size_t size
const char int apr_pool_t * pool
Definition apr_cstr.h:84
int apr_status_t
Definition apr_errno.h:44
void * data
apr_vformatter_buff_t const char va_list ap
Definition apr_lib.h:176
apr_pool_t * parent
Definition apr_pools.h:197
const char * s
Definition apr_strings.h:95
apr_int64_t apr_interval_time_t
Definition apr_time.h:55
Apache Configuration.
Apache Logging library.
HTTP Daemon routines.
apr_pool_t * p
Definition md_event.c:32
static ap_watchdog_t * watchdog
static apr_status_t ap_watchdog_register_callback(ap_watchdog_t *w, apr_interval_time_t interval, const void *data, ap_watchdog_callback_fn_t *callback)
static apr_status_t ap_watchdog_get_instance(ap_watchdog_t **watchdog, const char *name, int parent, int singleton, apr_pool_t *p)
static apr_status_t ap_watchdog_set_callback_interval(ap_watchdog_t *w, apr_interval_time_t interval, const void *data, ap_watchdog_callback_fn_t *callback)
char * name
A structure to store information for each virtual server.
Definition httpd.h:1322