From: Koundinya Veluri Date: Sat, 14 Jan 2017 05:18:34 +0000 (-0800) Subject: Remove invalid asserts in threads.cpp, DoAppropriateWaitWorker(int, ...) X-Git-Tag: submit/tizen/20210909.063632~11030^2~8443^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6901e5d2dadac88b49cbf5bc219f46f341db16d2;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Remove invalid asserts in threads.cpp, DoAppropriateWaitWorker(int, ...) These cases are actually possible because Windows APIs are inconsistent in their behavior when invalid handles are concerned. Depending on the invalid handle's value, a multi-wait can error with ERROR_INVALID_HANDLE, and a single-wait on an invalid handle could return WAIT_TIMEOUT. Commit migrated from https://github.com/dotnet/coreclr/commit/4367c8d5205f233ddf9db2c0d23a330d4b72d05c --- diff --git a/src/coreclr/src/vm/threads.cpp b/src/coreclr/src/vm/threads.cpp index 732cb2d..5a2816b 100644 --- a/src/coreclr/src/vm/threads.cpp +++ b/src/coreclr/src/vm/threads.cpp @@ -4533,9 +4533,6 @@ retry: { // Probe all handles with a timeout of zero. When we find one that's // invalid, move it out of the list and retry the wait. -#ifdef _DEBUG - BOOL fFoundInvalid = FALSE; -#endif for (int i = 0; i < countHandles; i++) { // WaitForSingleObject won't pump memssage; we already probe enough space @@ -4548,12 +4545,8 @@ retry: if ((countHandles - i - 1) > 0) memmove(&handles[i], &handles[i+1], (countHandles - i - 1) * sizeof(HANDLE)); countHandles--; -#ifdef _DEBUG - fFoundInvalid = TRUE; -#endif break; } - _ASSERTE(fFoundInvalid); // Compute the new timeout value by assume that the timeout // is not large enough for more than one wrap @@ -4599,7 +4592,6 @@ retry: _ASSERTE(subRet == WAIT_TIMEOUT); ret++; } - _ASSERTE(i != countHandles); } }