From a18aa2cd73d7564e28591908c30234c317cc094c Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 17 Jun 2022 15:06:30 +0200 Subject: [PATCH] gh-74953: Fix PyThread_acquire_lock_timed() code recomputing the timeout Set timeout, don't create a local variable with the same name. --- Python/thread_pthread.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h index 1b2c28d0f39929..849d8d87d16cf5 100644 --- a/Python/thread_pthread.h +++ b/Python/thread_pthread.h @@ -504,7 +504,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;