summaryrefslogtreecommitdiff
path: root/Modules/_threadmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-03-30 03:49:14 +0200
committerVictor Stinner <victor.stinner@gmail.com>2015-03-30 03:49:14 +0200
commit869e1778c0bcfc0928701c6ae0703934359d036b (patch)
tree231b2e09d453cca2ce5bf462ffb91f0f7303f3c0 /Modules/_threadmodule.c
parentbcdd777d3c01a6db3b4357922663624ef617e65a (diff)
downloadcpython-git-869e1778c0bcfc0928701c6ae0703934359d036b.tar.gz
Issue #22117: Replace usage of _PyTime_ROUND_UP with _PyTime_ROUND_CEILING
All these functions only accept positive timeouts, so this change has no effect in practice.
Diffstat (limited to 'Modules/_threadmodule.c')
-rw-r--r--Modules/_threadmodule.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Modules/_threadmodule.c b/Modules/_threadmodule.c
index 07b01f09c4..0907aa0eb2 100644
--- a/Modules/_threadmodule.c
+++ b/Modules/_threadmodule.c
@@ -59,7 +59,7 @@ acquire_timed(PyThread_type_lock lock, _PyTime_t timeout)
endtime = _PyTime_GetMonotonicClock() + timeout;
do {
- microseconds = _PyTime_AsMicroseconds(timeout, _PyTime_ROUND_UP);
+ microseconds = _PyTime_AsMicroseconds(timeout, _PyTime_ROUND_CEILING);
/* first a simple non-blocking try without releasing the GIL */
r = PyThread_acquire_lock_timed(lock, 0, 0);
@@ -110,7 +110,8 @@ lock_acquire_parse_args(PyObject *args, PyObject *kwds,
return -1;
if (timeout_obj
- && _PyTime_FromSecondsObject(timeout, timeout_obj, _PyTime_ROUND_UP) < 0)
+ && _PyTime_FromSecondsObject(timeout,
+ timeout_obj, _PyTime_ROUND_CEILING) < 0)
return -1;
if (!blocking && *timeout != unset_timeout ) {
@@ -128,7 +129,7 @@ lock_acquire_parse_args(PyObject *args, PyObject *kwds,
else if (*timeout != unset_timeout) {
_PyTime_t microseconds;
- microseconds = _PyTime_AsMicroseconds(*timeout, _PyTime_ROUND_UP);
+ microseconds = _PyTime_AsMicroseconds(*timeout, _PyTime_ROUND_CEILING);
if (microseconds >= PY_TIMEOUT_MAX) {
PyErr_SetString(PyExc_OverflowError,
"timeout value is too large");