mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
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 f64557f480
)
Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
e6cca2e00b
commit
1353b8a4bc
1 changed files with 1 additions and 1 deletions
|
@ -506,7 +506,7 @@ PyThread_acquire_lock_timed(PyThread_type_lock lock, PY_TIMEOUT_T microseconds,
|
||||||
#ifndef HAVE_SEM_CLOCKWAIT
|
#ifndef HAVE_SEM_CLOCKWAIT
|
||||||
if (timeout > 0) {
|
if (timeout > 0) {
|
||||||
/* wait interrupted by a signal (EINTR): recompute the timeout */
|
/* wait interrupted by a signal (EINTR): recompute the timeout */
|
||||||
_PyTime_t timeout = _PyDeadline_Get(deadline);
|
timeout = _PyDeadline_Get(deadline);
|
||||||
if (timeout < 0) {
|
if (timeout < 0) {
|
||||||
status = ETIMEDOUT;
|
status = ETIMEDOUT;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue