]> granicus.if.org Git - apache/commitdiff
The final commit to achieve a quality release. We cannot use CreateThread
authorWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 13 Feb 2002 03:33:34 +0000 (03:33 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 13 Feb 2002 03:33:34 +0000 (03:33 +0000)
  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

server/mpm/winnt/service.c

index 8ffcf4c98e72f628bd6ce0a81bf6516e0982d717..8497b06e3f9d578efd6f1a25a2ab9e1405a71a2f 100644 (file)
@@ -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);
     }