From 4e904d4f4033f0b9f98631d4105bf197482dc854 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Fri, 26 Sep 2008 20:15:10 +0000 Subject: [PATCH] Reimplement ThreadStackSize to behave as on unix for any 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 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/server/mpm/winnt/child.c b/server/mpm/winnt/child.c index edd61cdc8a..0a0143f69d 100644 --- a/server/mpm/winnt/child.c +++ b/server/mpm/winnt/child.c @@ -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.", -- 2.50.1