diff options
author | Jeff Trawick <trawick@apache.org> | 2011-03-30 21:32:10 +0000 |
---|---|---|
committer | Jeff Trawick <trawick@apache.org> | 2011-03-30 21:32:10 +0000 |
commit | 3c0476fe509b3d8bc4839a266f5de9138c73acda (patch) | |
tree | 02de618be2053b7c24a13d18b136540e3bd94282 /include/mpm_common.h | |
parent | b1e1cff7f9e54355e978ed050935ff0e9e74047c (diff) | |
download | httpd-3c0476fe509b3d8bc4839a266f5de9138c73acda.tar.gz |
Simplify the interface to ap_reclaim_child_processes() and
ap_relieve_child_processes(): instead of requiring the MPM
to implement an otherwise-useless hook, just use a callback
function.
As I don't expect third-party MPM devs are following our day
to day progress, the API changes are considered part of
yesterday's MMN change.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1087085 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include/mpm_common.h')
-rw-r--r-- | include/mpm_common.h | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/include/mpm_common.h b/include/mpm_common.h index 3f66f793ea..c77d4664a5 100644 --- a/include/mpm_common.h +++ b/include/mpm_common.h @@ -81,34 +81,35 @@ extern "C" { #define AP_SIG_GRACEFUL_STOP_STRING "SIGWINCH" /** + * Callback function used for ap_reclaim_child_processes() and + * ap_relieve_child_processes(). The callback function will be + * called for each terminated child process. + */ +typedef void ap_reclaim_callback_fn_t(int childnum); + +/** * Make sure all child processes that have been spawned by the parent process * have died. This includes process registered as "other_children". * @param terminate Either 1 or 0. If 1, send the child processes SIGTERM * each time through the loop. If 0, give the process time to die * on its own before signalling it. - * @note This function requires that a hook is implemented by the MPM: <pre> - * mpm_note_child_killed -- Note the child died in the scoreboard - * </pre> * * @note The MPM child processes which are reclaimed are those listed * in the scoreboard as well as those currently registered via * ap_register_extra_mpm_process(). */ -void ap_reclaim_child_processes(int terminate); +void ap_reclaim_child_processes(int terminate, + ap_reclaim_callback_fn_t *mpm_callback); /** * Catch any child processes that have been spawned by the parent process * which have exited. This includes processes registered as "other_children". * - * @note This function requires that a hook is implemented by the MPM: <pre> - * mpm_note_child_killed -- Note the child died in the scoreboard - * </pre> - * * @note The MPM child processes which are relieved are those listed * in the scoreboard as well as those currently registered via * ap_register_extra_mpm_process(). */ -void ap_relieve_child_processes(void); +void ap_relieve_child_processes(ap_reclaim_callback_fn_t *mpm_callback); /** * Tell ap_reclaim_child_processes() and ap_relieve_child_processes() about @@ -333,13 +334,6 @@ AP_DECLARE_HOOK(int, drop_privileges, (apr_pool_t * pchild, server_rec * s)) */ AP_DECLARE_HOOK(int, mpm_query, (int query_code, int *result, apr_status_t *rv)) -/* child specified by index has been killed; MPMs which use - * ap_reclaim_child_processes() or ap_relieve_child_processes() must - * implement this in order to update the scoreboard and handle any - * MPM-specific actions - */ -AP_DECLARE_HOOK(apr_status_t, mpm_note_child_killed, (int childnum)) - /* register the specified callback */ AP_DECLARE_HOOK(apr_status_t, mpm_register_timed_callback, (apr_time_t t, ap_mpm_callback_fn_t *cbfn, void *baton)) |