]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-41299: Fix EnterNonRecursiveMutex() (GH-28548)
authorVictor Stinner <vstinner@python.org>
Fri, 24 Sep 2021 22:40:18 +0000 (00:40 +0200)
committerGitHub <noreply@github.com>
Fri, 24 Sep 2021 22:40:18 +0000 (00:40 +0200)
Remove Py_FatalError() call: the code works even if now is negative.

Python/thread_nt.h

index 0ce5e94f89bf72dfde09916088e6682ed9ad1e83..e9dc880115f6950b4afef135c9a9cbc26be6fb5d 100644 (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) {