Skip to content

Commit 1353b8a

Browse files
gh-74953: Fix PyThread_acquire_lock_timed() code recomputing the timeout (GH-93941)
Set timeout, don't create a local variable with the same name. (cherry picked from commit f64557f) Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent e6cca2e commit 1353b8a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/thread_pthread.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ PyThread_acquire_lock_timed(PyThread_type_lock lock, PY_TIMEOUT_T microseconds,
506506
#ifndef HAVE_SEM_CLOCKWAIT
507507
if (timeout > 0) {
508508
/* wait interrupted by a signal (EINTR): recompute the timeout */
509-
_PyTime_t timeout = _PyDeadline_Get(deadline);
509+
timeout = _PyDeadline_Get(deadline);
510510
if (timeout < 0) {
511511
status = ETIMEDOUT;
512512
break;

0 commit comments

Comments
 (0)