diff options
author | William A. Rowe Jr <wrowe@apache.org> | 2007-12-28 19:04:06 +0000 |
---|---|---|
committer | William A. Rowe Jr <wrowe@apache.org> | 2007-12-28 19:04:06 +0000 |
commit | 3610c7d8f404d58f486fc30b20c87069b314fd58 (patch) | |
tree | 0683c9f3e8efbd5d32406d6b04ce854ba7bb5448 /os/win32 | |
parent | b353ce6b03b7fdfb42b03fcae26657fcde592872 (diff) | |
download | httpd-3610c7d8f404d58f486fc30b20c87069b314fd58.tar.gz |
Refactor releasing the child processes by eliminating the
time lookup, eliminating the bogus/misimplemented function,
and introducing fairness to release any dead threads before
getting hung up on releasing longer lived threads.
Also pick up the time-to-wait from the server global timeout.
And finally, axe a completely bogus internal helper function.
Backports: r573103, r573105
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.0.x@607310 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'os/win32')
-rw-r--r-- | os/win32/os.h | 3 | ||||
-rw-r--r-- | os/win32/util_win32.c | 39 |
2 files changed, 0 insertions, 42 deletions
diff --git a/os/win32/os.h b/os/win32/os.h index c250ebff40..56fc8b6f9d 100644 --- a/os/win32/os.h +++ b/os/win32/os.h @@ -76,9 +76,6 @@ FARPROC ap_load_dll_func(ap_dlltoken_e fnLib, char* fnName, int ordinal); 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); diff --git a/os/win32/util_win32.c b/os/win32/util_win32.c index 2a5d0583ea..c6c3840478 100644 --- a/os/win32/util_win32.c +++ b/os/win32/util_win32.c @@ -145,42 +145,3 @@ void CleanNullACL(void *sa) 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) -{ - time_t tStopTime; - DWORD dwRet = WAIT_TIMEOUT; - DWORD dwIndex=0; - BOOL bFirst = TRUE; - - tStopTime = time(NULL) + dwSeconds; - - 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_TIMEOUT) { - break; - } - } - } while((time(NULL) < tStopTime) && (dwRet == WAIT_TIMEOUT)); - - return dwRet; -} |