aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/lock.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/lock.c')
-rw-r--r--Python/lock.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Python/lock.c b/Python/lock.c
index 28a12ad1835..ea6ac00bfec 100644
--- a/Python/lock.c
+++ b/Python/lock.c
@@ -58,7 +58,7 @@ _PyMutex_LockTimed(PyMutex *m, PyTime_t timeout, _PyLockFlags flags)
return PY_LOCK_ACQUIRED;
}
}
- else if (timeout == 0) {
+ if (timeout == 0) {
return PY_LOCK_FAILURE;
}
@@ -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;