use loops instead of gotos

svn path=/trunk/; revision=17192
This commit is contained in:
Thomas Bluemel 2005-08-08 00:45:04 +00:00
parent afcb29cc7c
commit e41e25c1e1

View file

@ -90,7 +90,9 @@ WaitForSingleObjectEx(HANDLE hHandle,
Time.QuadPart = -10000 * (LONGLONG)dwMilliseconds;
TimePtr = &Time;
}
WaitAgain:
do
{
Status = NtWaitForSingleObject(hHandle,
(BOOLEAN) bAlertable,
TimePtr);
@ -100,7 +102,8 @@ WaitAgain:
SetLastErrorByStatus (Status);
return WAIT_FAILED;
}
if (Status == STATUS_ALERTED && bAlertable) goto WaitAgain;
} while (Status == STATUS_ALERTED && bAlertable);
return Status;
}
@ -211,7 +214,8 @@ WaitForMultipleObjectsEx(DWORD nCount,
TimePtr = &Time;
}
WaitAgain:
do
{
Status = NtWaitForMultipleObjects (nCount,
HandleBuffer,
bWaitAll ? WaitAll : WaitAny,
@ -222,7 +226,8 @@ WaitAgain:
SetLastErrorByStatus (Status);
Status = WAIT_FAILED;
}
if (Status == STATUS_ALERTED && bAlertable) goto WaitAgain;
} while (Status == STATUS_ALERTED && bAlertable);
if (HandleBuffer != Handle)
{
@ -283,7 +288,8 @@ SignalObjectAndWait(HANDLE hObjectToSignal,
TimePtr = &Time;
}
WaitAgain:
do
{
Status = NtSignalAndWaitForSingleObject (hObjectToSignal,
hObjectToWaitOn,
(BOOLEAN)bAlertable,
@ -293,7 +299,8 @@ WaitAgain:
SetLastErrorByStatus (Status);
return WAIT_FAILED;
}
if (Status == STATUS_ALERTED && bAlertable) goto WaitAgain;
} while (Status == STATUS_ALERTED && bAlertable);
/* STATUS_SUCCESS maps to WAIT_OBJECT_0 */
return Status;