diff options
author | Victor Stinner <vstinner@python.org> | 2022-06-17 14:11:25 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-17 14:11:25 (GMT) |
commit | f64557f4803528c53bb9a1d565e3cdf92e97152f (patch) | |
tree | 88db0227974869e1af98bd10e4b60260edb469d2 /Python | |
parent | e444752fabb691593af9e2f767419bb5fd6ba507 (diff) | |
download | cpython-f64557f4803528c53bb9a1d565e3cdf92e97152f.zip cpython-f64557f4803528c53bb9a1d565e3cdf92e97152f.tar.gz cpython-f64557f4803528c53bb9a1d565e3cdf92e97152f.tar.bz2 |
gh-74953: Fix PyThread_acquire_lock_timed() code recomputing the timeout (#93941)
Set timeout, don't create a local variable with the same name.
Diffstat (limited to 'Python')
-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 195b277..58b5999 100644 --- a/Python/thread_pthread.h +++ b/Python/thread_pthread.h @@ -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; |