mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 07:55:56 +00:00
Retry waiting if STATUS_ALERTED is returned
svn path=/trunk/; revision=17189
This commit is contained in:
parent
ae86070caa
commit
12de4ac145
1 changed files with 10 additions and 7 deletions
|
@ -90,7 +90,7 @@ WaitForSingleObjectEx(HANDLE hHandle,
|
|||
Time.QuadPart = -10000 * (LONGLONG)dwMilliseconds;
|
||||
TimePtr = &Time;
|
||||
}
|
||||
|
||||
WaitAgain:
|
||||
Status = NtWaitForSingleObject(hHandle,
|
||||
(BOOLEAN) bAlertable,
|
||||
TimePtr);
|
||||
|
@ -100,6 +100,7 @@ WaitForSingleObjectEx(HANDLE hHandle,
|
|||
SetLastErrorByStatus (Status);
|
||||
return WAIT_FAILED;
|
||||
}
|
||||
if (Status == STATUS_ALERTED && bAlertable) goto WaitAgain;
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
@ -210,20 +211,22 @@ WaitForMultipleObjectsEx(DWORD nCount,
|
|||
TimePtr = &Time;
|
||||
}
|
||||
|
||||
WaitAgain:
|
||||
Status = NtWaitForMultipleObjects (nCount,
|
||||
HandleBuffer,
|
||||
bWaitAll ? WaitAll : WaitAny,
|
||||
(BOOLEAN)bAlertable,
|
||||
TimePtr);
|
||||
if (HandleBuffer != Handle)
|
||||
{
|
||||
RtlFreeHeap(RtlGetProcessHeap(), 0, HandleBuffer);
|
||||
}
|
||||
|
||||
if (HIWORD(Status))
|
||||
{
|
||||
SetLastErrorByStatus (Status);
|
||||
return WAIT_FAILED;
|
||||
Status = WAIT_FAILED;
|
||||
}
|
||||
if (Status == STATUS_ALERTED && bAlertable) goto WaitAgain;
|
||||
|
||||
if (HandleBuffer != Handle)
|
||||
{
|
||||
RtlFreeHeap(RtlGetProcessHeap(), 0, HandleBuffer);
|
||||
}
|
||||
|
||||
return Status;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue