gh-134745: Change PyThread_allocate_lock() implementation to PyMutex (#134747)

Co-authored-by: Sam Gross <colesbury@gmail.com>
This commit is contained in:
Victor Stinner 2025-05-30 12:15:47 +02:00 committed by GitHub
parent 45c6c48afc
commit ebf6d13567
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 86 additions and 491 deletions

View file

@ -119,6 +119,9 @@ _PyMutex_LockTimed(PyMutex *m, PyTime_t timeout, _PyLockFlags flags)
return PY_LOCK_INTR;
}
}
else if (ret == Py_PARK_INTR && (flags & _PY_FAIL_IF_INTERRUPTED)) {
return PY_LOCK_INTR;
}
else if (ret == Py_PARK_TIMEOUT) {
assert(timeout >= 0);
return PY_LOCK_FAILURE;