mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 20:35:43 +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;
|
Time.QuadPart = -10000 * (LONGLONG)dwMilliseconds;
|
||||||
TimePtr = &Time;
|
TimePtr = &Time;
|
||||||
}
|
}
|
||||||
WaitAgain:
|
|
||||||
|
do
|
||||||
|
{
|
||||||
Status = NtWaitForSingleObject(hHandle,
|
Status = NtWaitForSingleObject(hHandle,
|
||||||
(BOOLEAN) bAlertable,
|
(BOOLEAN) bAlertable,
|
||||||
TimePtr);
|
TimePtr);
|
||||||
|
@ -100,7 +102,8 @@ WaitAgain:
|
||||||
SetLastErrorByStatus (Status);
|
SetLastErrorByStatus (Status);
|
||||||
return WAIT_FAILED;
|
return WAIT_FAILED;
|
||||||
}
|
}
|
||||||
if (Status == STATUS_ALERTED && bAlertable) goto WaitAgain;
|
|
||||||
|
} while (Status == STATUS_ALERTED && bAlertable);
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
@ -211,7 +214,8 @@ WaitForMultipleObjectsEx(DWORD nCount,
|
||||||
TimePtr = &Time;
|
TimePtr = &Time;
|
||||||
}
|
}
|
||||||
|
|
||||||
WaitAgain:
|
do
|
||||||
|
{
|
||||||
Status = NtWaitForMultipleObjects (nCount,
|
Status = NtWaitForMultipleObjects (nCount,
|
||||||
HandleBuffer,
|
HandleBuffer,
|
||||||
bWaitAll ? WaitAll : WaitAny,
|
bWaitAll ? WaitAll : WaitAny,
|
||||||
|
@ -222,7 +226,8 @@ WaitAgain:
|
||||||
SetLastErrorByStatus (Status);
|
SetLastErrorByStatus (Status);
|
||||||
Status = WAIT_FAILED;
|
Status = WAIT_FAILED;
|
||||||
}
|
}
|
||||||
if (Status == STATUS_ALERTED && bAlertable) goto WaitAgain;
|
|
||||||
|
} while (Status == STATUS_ALERTED && bAlertable);
|
||||||
|
|
||||||
if (HandleBuffer != Handle)
|
if (HandleBuffer != Handle)
|
||||||
{
|
{
|
||||||
|
@ -283,7 +288,8 @@ SignalObjectAndWait(HANDLE hObjectToSignal,
|
||||||
TimePtr = &Time;
|
TimePtr = &Time;
|
||||||
}
|
}
|
||||||
|
|
||||||
WaitAgain:
|
do
|
||||||
|
{
|
||||||
Status = NtSignalAndWaitForSingleObject (hObjectToSignal,
|
Status = NtSignalAndWaitForSingleObject (hObjectToSignal,
|
||||||
hObjectToWaitOn,
|
hObjectToWaitOn,
|
||||||
(BOOLEAN)bAlertable,
|
(BOOLEAN)bAlertable,
|
||||||
|
@ -293,7 +299,8 @@ WaitAgain:
|
||||||
SetLastErrorByStatus (Status);
|
SetLastErrorByStatus (Status);
|
||||||
return WAIT_FAILED;
|
return WAIT_FAILED;
|
||||||
}
|
}
|
||||||
if (Status == STATUS_ALERTED && bAlertable) goto WaitAgain;
|
|
||||||
|
} while (Status == STATUS_ALERTED && bAlertable);
|
||||||
|
|
||||||
/* STATUS_SUCCESS maps to WAIT_OBJECT_0 */
|
/* STATUS_SUCCESS maps to WAIT_OBJECT_0 */
|
||||||
return Status;
|
return Status;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue