diff options
author | ylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68> | 2022-06-24 15:58:48 +0000 |
---|---|---|
committer | ylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68> | 2022-06-24 15:58:48 +0000 |
commit | 51d77a398c7cc5fd87934a82f5210d7c845538d1 (patch) | |
tree | c7e3a0bc56b8882350e0b1a0863c449b08bad5df | |
parent | 680dd75576702b7183c227625559dfcd679d5577 (diff) | |
download | libapr-51d77a398c7cc5fd87934a82f5210d7c845538d1.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.
Merge r1902169 from trunk.
Submitted by: ylavic
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x@1902235 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | time/win32/time.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/time/win32/time.c b/time/win32/time.c index ac75b7b6f..170a9eea8 100644 --- a/time/win32/time.c +++ b/time/win32/time.c @@ -314,7 +314,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)); } #if defined(_WIN32_WCE) |