]> granicus.if.org Git - apache/commitdiff
Adapt the mpm_netware version of the ThreadStackSize directive to the common version
authorBradley Nicholes <bnicholes@apache.org>
Wed, 17 Mar 2004 19:47:08 +0000 (19:47 +0000)
committerBradley Nicholes <bnicholes@apache.org>
Wed, 17 Mar 2004 19:47:08 +0000 (19:47 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@103013 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/netware/mpm.h
server/mpm/netware/mpm_default.h
server/mpm/netware/mpm_netware.c

index 129f74f71a73fbbb33d55b613fae29735c652314..68528ff131a9ce7ee15eeee950a6d3f6ef3bf445 100644 (file)
@@ -31,6 +31,7 @@
 */
 #define AP_MPM_WANT_SET_MAX_REQUESTS
 #define AP_MPM_WANT_SET_MAX_MEM_FREE
+#define AP_MPM_WANT_SET_STACKSIZE
 #define AP_MPM_DISABLE_NAGLE_ACCEPTED_SOCK
 /*#define AP_MPM_WANT_SET_COREDUMPDIR
   #define AP_MPM_WANT_SET_ACCEPT_LOCK_MECH 
@@ -40,7 +41,6 @@
 #define MPM_NOTE_CHILD_KILLED(i) (MPM_CHILD_PID(i) = 0)
 
 extern int ap_threads_per_child;
-extern int ap_thread_stack_size;
 extern int ap_max_workers_limit;
 extern server_rec *ap_server_conf;
 
index 8f1aac7ace128cf363a146db2be998e76b577427..f0bddbd0d85b782c12346db6db46ef4af1d70b68 100644 (file)
 #define DEFAULT_MAX_REQUESTS_PER_CHILD 0
 #endif
 
+/* Default stack size allocated for each worker thread.
+ */
+#ifndef DEFAULT_THREAD_STACKSIZE
+#define DEFAULT_THREAD_STACKSIZE 65536
+#endif
+
 #endif /* AP_MPM_DEFAULT_H */
index 0bda3363484681a0ebf82c5d2ba8ada8f23c6e77..34e8cbf56eb80c97d74f25d3285067be62eb792d 100644 (file)
 /* config globals */
 
 int ap_threads_per_child=0;         /* Worker threads per child */
-int ap_thread_stack_size=65536;
 static int ap_threads_to_start=0;
 static int ap_threads_min_free=0;
 static int ap_threads_max_free=0;
@@ -527,7 +526,7 @@ static int make_child(server_rec *s, int slot)
     ap_update_child_status_from_indexes(0, slot, WORKER_STARTING, 
                                         (request_rec *) NULL);
 
-    if (ctx = NXContextAlloc((void (*)(void *)) worker_main, (void*)slot, NX_PRIO_MED, ap_thread_stack_size, NX_CTX_NORMAL, &err)) {
+    if (ctx = NXContextAlloc((void (*)(void *)) worker_main, (void*)slot, NX_PRIO_MED, ap_thread_stacksize, NX_CTX_NORMAL, &err)) {
         char threadName[32];
 
         sprintf (threadName, "Apache_Worker %d", slot);
@@ -980,6 +979,7 @@ static int netware_pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp
     ap_threads_limit = HARD_THREAD_LIMIT;
     ap_max_requests_per_child = DEFAULT_MAX_REQUESTS_PER_CHILD;
     ap_extended_status = 0;
+    ap_thread_stacksize = DEFAULT_THREAD_STACKSIZE;
 #ifdef AP_MPM_WANT_SET_MAX_MEM_FREE
        ap_max_mem_free = APR_ALLOCATOR_MAX_FREE_UNLIMITED;
 #endif
@@ -1258,21 +1258,7 @@ static const char *set_thread_limit (cmd_parms *cmd, void *dummy, const char *ar
     return NULL;
 }
 
-static const char *set_thread_stacksize(cmd_parms *cmd, void *dummy, 
-                                        const char *arg)
-{
-    const char *err = ap_check_cmd_context(cmd, GLOBAL_ONLY);
-    if (err != NULL) {
-        return err;
-    }
-    
-    ap_thread_stack_size = atoi(arg);
-    return NULL;
-}
-
 static const command_rec netware_mpm_cmds[] = {
-AP_INIT_TAKE1("ThreadStackSize", set_thread_stacksize, NULL, RSRC_CONF,
-              "Stack size each created thread will use."),
 LISTEN_COMMANDS,
 AP_INIT_TAKE1("StartThreads", set_threads_to_start, NULL, RSRC_CONF,
               "Number of worker threads launched at server startup"),