151
* The Win32 call WaitForMultipleObjects will only allow you to wait for
152
* a maximum of MAXIMUM_WAIT_OBJECTS (current 64). Since the threading
153
* model in the multithreaded version of apache wants to use this call,
154
* we are restricted to a maximum of 64 threads. This is a simplistic
155
* routine that will increase this size.
157
DWORD wait_for_many_objects(DWORD nCount, CONST HANDLE *lpHandles,
161
DWORD dwRet = WAIT_TIMEOUT;
165
tStopTime = time(NULL) + dwSeconds;
173
for (dwIndex = 0; dwIndex * MAXIMUM_WAIT_OBJECTS < nCount; dwIndex++) {
174
dwRet = WaitForMultipleObjects(
175
min(MAXIMUM_WAIT_OBJECTS, nCount - (dwIndex * MAXIMUM_WAIT_OBJECTS)),
176
lpHandles + (dwIndex * MAXIMUM_WAIT_OBJECTS),
179
if (dwRet != WAIT_TIMEOUT) {
183
} while((time(NULL) < tStopTime) && (dwRet == WAIT_TIMEOUT));