From: Mladen Turk Date: Thu, 3 Aug 2006 08:24:44 +0000 (+0000) Subject: Do not return on WAIT_ABANDONED signals. X-Git-Tag: 2.3.0~2177 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=496195bdd82acada061f05e11f6d685718f03590;p=thirdparty%2Fapache%2Fhttpd.git Do not return on WAIT_ABANDONED signals. It means that we got the ownership, not that the object was signaled. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@428278 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/os/win32/util_win32.c b/os/win32/util_win32.c index e8ba49c760e..4113602d89f 100644 --- a/os/win32/util_win32.c +++ b/os/win32/util_win32.c @@ -157,12 +157,12 @@ void CleanNullACL(void *sa) DWORD wait_for_many_objects(DWORD nCount, CONST HANDLE *lpHandles, DWORD dwSeconds) { - time_t tStopTime; + DWORD dwStopTime; DWORD dwRet = WAIT_FAILED; - DWORD dwIndex=0; + DWORD dwIndex = 0; BOOL bFirst = TRUE; - tStopTime = time(NULL) + dwSeconds; + dwStopTime = GetTickCount() + dwSeconds * 1000; do { if (!bFirst) @@ -179,16 +179,19 @@ DWORD wait_for_many_objects(DWORD nCount, CONST HANDLE *lpHandles, return dwRet; } if (dwRet != WAIT_TIMEOUT) { - if (dwRet >= WAIT_ABANDONED_0) - dwRet = dwRet - WAIT_ABANDONED_0; - else - dwRet = dwRet - WAIT_OBJECT_0; - dwRet = dwRet + (dwIndex * MAXIMUM_WAIT_OBJECTS); - break; + 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((time(NULL) < tStopTime) && (dwRet == WAIT_FAILED)); + } while((GetTickCount() < dwStopTime) && (dwRet == WAIT_FAILED)); return dwRet; }