Skip to content

Commit

Permalink
pythongh-74953: Fix PyThread_acquire_lock_timed() code recomputing th…
Browse files Browse the repository at this point in the history
…e timeout (pythonGH-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
vstinner authored and miss-islington committed Jun 17, 2022
1 parent e6cca2e commit 6d03bba
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 6d03bba

Please sign in to comment.