]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-74953: Fix PyThread_acquire_lock_timed() code recomputing the timeout (#93941)
authorVictor Stinner <vstinner@python.org>
Fri, 17 Jun 2022 14:11:25 +0000 (16:11 +0200)
committerGitHub <noreply@github.com>
Fri, 17 Jun 2022 14:11:25 +0000 (16:11 +0200)
Set timeout, don't create a local variable with the same name.

Python/thread_pthread.h

index 195b277dfba502f737c9414143b636c0413fee8c..58b5999add388dd8fc6f89d7d045aad76d108a4c 100644 (file)
@@ -497,7 +497,7 @@ PyThread_acquire_lock_timed(PyThread_type_lock lock, PY_TIMEOUT_T microseconds,
 #ifndef HAVE_SEM_CLOCKWAIT
         if (timeout > 0) {
             /* wait interrupted by a signal (EINTR): recompute the timeout */
-            _PyTime_t timeout = _PyDeadline_Get(deadline);
+            timeout = _PyDeadline_Get(deadline);
             if (timeout < 0) {
                 status = ETIMEDOUT;
                 break;