]> git.ipfire.org Git - thirdparty/apache/httpd.git/commit
mpm_winnt: Avoid using TerminateThread() in case the shutdown routine
authorEvgeny Kotkov <kotkov@apache.org>
Tue, 11 Jul 2017 16:46:47 +0000 (16:46 +0000)
committerEvgeny Kotkov <kotkov@apache.org>
Tue, 11 Jul 2017 16:46:47 +0000 (16:46 +0000)
commit5c1f5c7b2824da01840f234c25b06330783357fa
treeeb5368eb411880dbcdccfd6fe24a2c95e09210bc
parent180026b4f4605facb3e46e56aa31e9e088a02631
mpm_winnt: Avoid using TerminateThread() in case the shutdown routine
hits a timeout while waiting for the worker threads to exit.

Using TerminateThread() can have dangerous consequences such as deadlocks —
say, if the the thread is terminated while holding a lock or a heap lock
in the middle of HeapAlloc(), as these locks would not be released.
Or it can corrupt the application state and cause a crash.

(See https://msdn.microsoft.com/en-us/library/windows/desktop/ms686717)

Rework the code to call TerminateProcess() in the described circumstances
and leave the cleanup to the operating system.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1801636 13f79535-47bb-0310-9956-ffa450edef68
server/mpm/winnt/child.c