mpm_winnt: Drop the APLOG_DEBUG diagnostic saying how many thread are blocked on the I/O completion port during the shutdown.
Prior to r1801635, the shutdown code required to know the amount of blocked threads, as it has been dispatching the same amount of completion packets. But this no longer holds, and the only reason why we maintain the corresponding g_blocked_threads variable is because of this debug diagnostic message.
Drop it in order to reduce complexity of the quite critical code in the winnt_get_connection() function and to reduce the amount of global variables.
mpm_winnt: Remove an unnecessary Sleep() in the winnt_accept() function.
This sleep occured in a situation when:
- We don't have a free completion context in the queue - We can't add one, as doing so would exceed the max_num_completion_contexts limit (all worker threads are busy) - We have exceeded a 1 second timeout while waiting for it
In this case, the Sleep() call is unnecessary, as there is no intermittent failure that can be waited out, but rather than that, it's an ordinary situation with all workers being busy. Presumably, calling Sleep() here can be even considered harmful, as it affects the fairness between the listeners that are blocked waiting for the completion context.
So, instead of calling Sleep() just check for the possible shutdown and immediately retry acquiring a completion context. If all worker threads are still busy, the retry will block in the same WaitForSingleObject() call, which is fine.