mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
use loops instead of gotos
svn path=/trunk/; revision=17192
This commit is contained in:
parent
afcb29cc7c
commit
e41e25c1e1
1 changed files with 37 additions and 30 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue