diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-06-17 14:39:27 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-17 14:39:27 (GMT) |
commit | 1353b8a4bcef22d985a0b6a186c96439fd540ea8 (patch) | |
tree | d4f0af50266732fc51c2637a4d403eb8459ea298 /Python/thread_pthread.h | |
parent | e6cca2e00bf9a3566cb47c417f4d0f480cd4eeb9 (diff) | |
download | cpython-1353b8a4bcef22d985a0b6a186c96439fd540ea8.zip cpython-1353b8a4bcef22d985a0b6a186c96439fd540ea8.tar.gz cpython-1353b8a4bcef22d985a0b6a186c96439fd540ea8.tar.bz2 |
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 f64557f4803528c53bb9a1d565e3cdf92e97152f)
Co-authored-by: Victor Stinner <vstinner@python.org>
Diffstat (limited to 'Python/thread_pthread.h')
-rw-r--r-- | Python/thread_pthread.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/thread_pthread.h b/Python/thread_pthread.h index c90ab25..02c8427 100644 --- a/Python/thread_pthread.h +++ b/Python/thread_pthread.h @@ -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; |