]> granicus.if.org Git - apache/commitdiff
Reimplement ThreadStackSize to behave as on unix for any
authorWilliam A. Rowe Jr <wrowe@apache.org>
Fri, 26 Sep 2008 20:15:10 +0000 (20:15 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Fri, 26 Sep 2008 20:15:10 +0000 (20:15 +0000)
Windows 2003/2008 (XP/Vista) servers.  Virtual allocations
will only consume pages once referenced, while the page
alignment will vary by ThreadStackSize setting so that the
maximum number of threads and minimum stack VM profile will
be wasted.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@699481 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/winnt/child.c

index edd61cdc8ad33d6d4c47279f4168a7390664fa0e..0a0143f69ddd3531889bea1e919ffe2c4a4fb62f 100644 (file)
@@ -984,13 +984,14 @@ void child_main(apr_pool_t *pconf)
                 continue;
             }
             ap_update_child_status_from_indexes(0, i, SERVER_STARTING, NULL);
-            child_handles[i] = (HANDLE) _beginthreadex(
-                                            NULL, (unsigned)ap_thread_stacksize,
-                                            worker_main, (void *) i, 0, &tid);
+        
+            child_handles[i] = CreateThread(NULL, ap_thread_stacksize,
+                                            worker_main, (void *) i,
+                                            stack_res_flag, &tid);
             if (child_handles[i] == 0) {
                 ap_log_error(APLOG_MARK, APLOG_CRIT, apr_get_os_error(),
                              ap_server_conf,
-                             "Child %d: _beginthreadex failed. Unable to "
+                             "Child %d: CreateThread failed. Unable to "
                              "create all worker threads. Created %d of the %d "
                              "threads requested with the ThreadsPerChild "
                              "configuration directive.",