bpo-41299: Fix EnterNonRecursiveMutex() (GH-28548)

Remove Py_FatalError() call: the code works even if now is negative.
This commit is contained in:
Victor Stinner 2021-09-25 00:40:18 +02:00 committed by GitHub
parent f35ddf2422
commit d639e31705
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -77,9 +77,6 @@ EnterNonRecursiveMutex(PNRMUTEX mutex, DWORD milliseconds)
} else if (milliseconds != 0) {
/* wait at least until the target */
_PyTime_t now = _PyTime_GetPerfCounter();
if (now <= 0) {
Py_FatalError("_PyTime_GetPerfCounter() == 0");
}
_PyTime_t nanoseconds = _PyTime_FromNanoseconds((_PyTime_t)milliseconds * 1000000);
_PyTime_t target = now + nanoseconds;
while (mutex->locked) {