Skip to content

Commit f64557f

Browse files
authored
gh-74953: Fix PyThread_acquire_lock_timed() code recomputing the timeout (#93941)
Set timeout, don't create a local variable with the same name.
1 parent e444752 commit f64557f

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
@@ -497,7 +497,7 @@ PyThread_acquire_lock_timed(PyThread_type_lock lock, PY_TIMEOUT_T microseconds,
497497
#ifndef HAVE_SEM_CLOCKWAIT
498498
if (timeout > 0) {
499499
/* wait interrupted by a signal (EINTR): recompute the timeout */
500-
_PyTime_t timeout = _PyDeadline_Get(deadline);
500+
timeout = _PyDeadline_Get(deadline);
501501
if (timeout < 0) {
502502
status = ETIMEDOUT;
503503
break;

0 commit comments

Comments
 (0)