PSECURITY_ATTRIBUTES GetNullACL();
void CleanNullACL(void *sa);
-DWORD wait_for_many_objects(DWORD nCount, CONST HANDLE *lpHandles,
- DWORD dwSeconds);
-
int set_listeners_noninheritable(apr_pool_t *p);
LocalFree(sa);
}
}
-
-
-/*
- * The Win32 call WaitForMultipleObjects will only allow you to wait for
- * a maximum of MAXIMUM_WAIT_OBJECTS (current 64). Since the threading
- * model in the multithreaded version of apache wants to use this call,
- * we are restricted to a maximum of 64 threads. This is a simplistic
- * routine that will increase this size.
- */
-DWORD wait_for_many_objects(DWORD nCount, CONST HANDLE *lpHandles,
- DWORD dwSeconds)
-{
- DWORD dwStopTime;
- DWORD dwRet = WAIT_FAILED;
- DWORD dwIndex = 0;
- BOOL bFirst = TRUE;
-
- dwStopTime = GetTickCount() + dwSeconds * 1000;
-
- do {
- if (!bFirst)
- Sleep(1000);
- else
- bFirst = FALSE;
-
- for (dwIndex = 0; dwIndex * MAXIMUM_WAIT_OBJECTS < nCount; dwIndex++) {
- dwRet = WaitForMultipleObjects(
- min(MAXIMUM_WAIT_OBJECTS, nCount - (dwIndex * MAXIMUM_WAIT_OBJECTS)),
- lpHandles + (dwIndex * MAXIMUM_WAIT_OBJECTS),
- 0, 0);
- if (dwRet == WAIT_FAILED) {
- return dwRet;
- }
- if (dwRet != WAIT_TIMEOUT) {
- if (dwRet >= WAIT_ABANDONED_0) {
- /* We just got the ownership of the object.
- * It does not mean that the object is signaled.
- */
- }
- else {
- dwRet = dwRet - WAIT_OBJECT_0 + (dwIndex * MAXIMUM_WAIT_OBJECTS);
- break;
- }
- }
- dwRet = WAIT_FAILED;
- }
- } while((GetTickCount() < dwStopTime) && (dwRet == WAIT_FAILED));
-
- return dwRet;
-}