summaryrefslogtreecommitdiff
path: root/time
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2022-06-22 12:50:22 +0000
committerYann Ylavic <ylavic@apache.org>2022-06-22 12:50:22 +0000
commit6634baa26593d9011d98eeb0a739b09908caa291 (patch)
tree7990e54d59acf6c145ea115f2c611918d6cf6f0d /time
parent0c8a6674cbf64f3ef39021f721429cae15ceb453 (diff)
downloadapr-6634baa26593d9011d98eeb0a739b09908caa291.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
Diffstat (limited to 'time')
-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)