]> granicus.if.org Git - apache/commitdiff
Fix the assertion if the WaitForMutipleObjects
authorMladen Turk <mturk@apache.org>
Wed, 2 Aug 2006 14:36:24 +0000 (14:36 +0000)
committerMladen Turk <mturk@apache.org>
Wed, 2 Aug 2006 14:36:24 +0000 (14:36 +0000)
returns WAIT_ABANDONED_NN instead presumed
WAIT_OBJECT_NN. This will correctly close the thread
handle without using invalid thread handle array index.

Spotted when large balancer timeout was set
and all the threads were busy waiting for the
connection:
[Wed Aug 02 14:29:58 2006] [crit] [Wed Aug 02 14:29:58 2006] file \\build-2.2.2\\server\\mpm\\winnt\\child.c, line 1120, assertion "(rv >= 0) && (rv < threads_created)" failed

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

server/mpm/winnt/child.c

index d950869806ab4e3f53096bbf6f78e9b52fa852c8..f4381bc0d0a504ac5cd7dfc7554e7f6c0615b0c8 100644 (file)
@@ -1120,7 +1120,10 @@ void child_main(apr_pool_t *pconf)
     while (threads_created) {
         rv = wait_for_many_objects(threads_created, child_handles, (DWORD)(end_time - time(NULL)));
         if (rv != WAIT_TIMEOUT) {
-            rv = rv - WAIT_OBJECT_0;
+            if (rv >= WAIT_ABANDONED_0)
+                rv = rv - WAIT_ABANDONED_0;
+            else        
+                rv = rv - WAIT_OBJECT_0;
             ap_assert((rv >= 0) && (rv < threads_created));
             cleanup_thread(child_handles, &threads_created, rv);
             continue;