From: William A. Rowe Jr Date: Wed, 13 Feb 2002 03:33:34 +0000 (+0000) Subject: The final commit to achieve a quality release. We cannot use CreateThread X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=93d3d83585367a3ea524f52f647efc2ad55a2206;p=apache The final commit to achieve a quality release. We cannot use CreateThread on Win32 when using the clib; msvcrt has its own initialization and destruction, so it needs its own turn. _createthreadex is the same but different - it's implemented by msvcrt and causes all the appropriate setup and teardown to occur. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93385 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/winnt/service.c b/server/mpm/winnt/service.c index 8ffcf4c98e..8497b06e3f 100644 --- a/server/mpm/winnt/service.c +++ b/server/mpm/winnt/service.c @@ -642,8 +642,8 @@ static void __stdcall service_nt_main_fn(DWORD argc, LPTSTR *argv) { CloseHandle(hPipeWrite); hPipeWrite = hDup; - thread = CreateThread(NULL, 0, service_stderr_thread, - (LPVOID) hPipeRead, 0, &threadid); + thread = (HANDLE) _beginthreadex(NULL, 0, service_stderr_thread, + (LPVOID) hPipeRead, 0, &threadid); if (thread) { FILE *fl, flip; @@ -875,7 +875,7 @@ apr_status_t mpm_service_to_start(const char **display_name) globdat.service_init = CreateEvent(NULL, FALSE, FALSE, NULL); globdat.service_term = CreateEvent(NULL, FALSE, FALSE, NULL); if (globdat.service_init) - globdat.service_thread = CreateThread(NULL, 0, + globdat.service_thread = (HANDLE) _beginthreadex(NULL, 0, service_nt_dispatch_thread, NULL, 0, &globdat.service_thread_id); @@ -887,9 +887,9 @@ apr_status_t mpm_service_to_start(const char **display_name) globdat.service_init = CreateEvent(NULL, FALSE, FALSE, NULL); if (globdat.service_init) - globdat.service_thread = CreateThread(NULL, 0, + globdat.service_thread = (HANDLE) _beginthreadex(NULL, 0, monitor_service_9x_thread, - (LPVOID) mpm_service_name, 0, + (LPVOID) mpm_service_name, 0, &globdat.service_thread_id); }