httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n..@apache.org
Subject svn commit: r188846 - in /httpd/httpd/trunk: include/mpm_common.h server/mpm_common.c
Date Tue, 07 Jun 2005 19:13:39 GMT
Author: niq
Date: Tue Jun  7 12:13:37 2005
New Revision: 188846

URL: http://svn.apache.org/viewcvs?rev=188846&view=rev
Log:
Add monitor hook (discussed under "watchdog" thread).


Modified:
    httpd/httpd/trunk/include/mpm_common.h
    httpd/httpd/trunk/server/mpm_common.c

Modified: httpd/httpd/trunk/include/mpm_common.h
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/include/mpm_common.h?rev=188846&r1=188845&r2=188846&view=diff
==============================================================================
--- httpd/httpd/trunk/include/mpm_common.h (original)
+++ httpd/httpd/trunk/include/mpm_common.h Tue Jun  7 12:13:37 2005
@@ -296,6 +296,8 @@
                                              const char *arg);
 #endif
 
+AP_DECLARE_HOOK(int,monitor,(apr_pool_t *p))
+
 #ifdef __cplusplus
 }
 #endif

Modified: httpd/httpd/trunk/server/mpm_common.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/server/mpm_common.c?rev=188846&r1=188845&r2=188846&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm_common.c (original)
+++ httpd/httpd/trunk/server/mpm_common.c Tue Jun  7 12:13:37 2005
@@ -59,6 +59,21 @@
 #include <unistd.h>
 #endif
 
+APR_HOOK_STRUCT(
+#if AP_ENABLE_EXCEPTION_HOOK
+    APR_HOOK_LINK(fatal_exception)
+#endif
+    APR_HOOK_LINK(monitor)
+)
+
+#if AP_ENABLE_EXCEPTION_HOOK
+AP_IMPLEMENT_HOOK_RUN_ALL(int, fatal_exception,
+                          (ap_exception_info_t *ei), (ei), OK, DECLINED)
+#endif
+AP_IMPLEMENT_HOOK_RUN_ALL(int, monitor,
+                          (apr_pool_t *p), (p), OK, DECLINED)
+
+
 #ifdef AP_MPM_WANT_RECLAIM_CHILD_PROCESSES
 
 typedef enum {DO_NOTHING, SEND_SIGTERM, SEND_SIGKILL, GIVEUP} action_t;
@@ -275,6 +290,7 @@
     ++wait_or_timeout_counter;
     if (wait_or_timeout_counter == INTERVAL_OF_WRITABLE_PROBES) {
         wait_or_timeout_counter = 0;
+        ap_run_monitor(p);
     }
 
     rv = apr_proc_wait_all_procs(ret, exitcode, status, APR_NOWAIT, p);
@@ -1027,13 +1043,6 @@
 
     return NULL;
 }
-
-APR_HOOK_STRUCT(
-    APR_HOOK_LINK(fatal_exception)
-)
-
-AP_IMPLEMENT_HOOK_RUN_ALL(int, fatal_exception,
-                          (ap_exception_info_t *ei), (ei), OK, DECLINED)
 
 static void run_fatal_exception_hook(int sig)
 {



Mime
View raw message