From: William A. Rowe Jr Date: Fri, 26 Sep 2008 20:15:10 +0000 (+0000) Subject: Reimplement ThreadStackSize to behave as on unix for any X-Git-Tag: 2.3.0~281 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4e904d4f4033f0b9f98631d4105bf197482dc854;p=apache 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 --- 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.",