summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68>2022-06-22 12:50:22 +0000
committerylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68>2022-06-22 12:50:22 +0000
commit89dc9e0d3bf4f7fe4c249fac56c946666e3d5e6c (patch)
tree7990e54d59acf6c145ea115f2c611918d6cf6f0d
parent275362c9ad61db50aad4adaf9f857b5027ebe602 (diff)
downloadlibapr-89dc9e0d3bf4f7fe4c249fac56c946666e3d5e6c.tar.gz
time: Don't apr_sleep() less than the requested time on WIN32.
Windows' Sleep() has millisecond granularity while the given apr_time_t to sleep is in microseconds, so round up. * time/win32/time.c(apr_sleep): Round up given time to upper milliseconds. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902169 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--time/win32/time.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/time/win32/time.c b/time/win32/time.c
index b4a73640a..a9b067f3a 100644
--- a/time/win32/time.c
+++ b/time/win32/time.c
@@ -268,7 +268,7 @@ APR_DECLARE(void) apr_sleep(apr_interval_time_t t)
/* One of the few sane situations for a cast, Sleep
* is in ms, not us, and passed as a DWORD value
*/
- Sleep((DWORD)(t / 1000));
+ Sleep((DWORD)((t + 999) / 1000));
}
static apr_status_t clock_restore(void *unsetres)