Skip to content

Commit

Permalink
gh-74953: Fix PyThread_acquire_lock_timed() code recomputing the time…
Browse files Browse the repository at this point in the history
…out (#93941)

Set timeout, don't create a local variable with the same name.
  • Loading branch information
vstinner authored Jun 17, 2022
1 parent e444752 commit f64557f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Python/thread_pthread.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f64557f

Please sign in to comment.