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 (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>
  • Loading branch information
miss-islington and vstinner committed Jun 17, 2022
1 parent e6cca2e commit 1353b8a
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 @@ -506,7 +506,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 1353b8a

Please sign in to comment.