diff options
author | Ivan Zhakov <ivan@apache.org> | 2019-05-27 17:11:23 +0000 |
---|---|---|
committer | Ivan Zhakov <ivan@apache.org> | 2019-05-27 17:11:23 +0000 |
commit | 992d5a67041b998c846515f00afc6196664da1e2 (patch) | |
tree | c21f1deecd4de7b23398e40dddc6884bf5a2831f /locks/win32/thread_cond.c | |
parent | 96d937e6e3e71d73d19d4fae28c95f5554ba7183 (diff) | |
parent | 944bfb5d1b282ea5ccdf023f7341641343da5a16 (diff) | |
download | apr-xmllite.tar.gz |
On 'xmllite' branch: Merge changes from trunk.xmllite
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/xmllite@1860149 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'locks/win32/thread_cond.c')
-rw-r--r-- | locks/win32/thread_cond.c | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/locks/win32/thread_cond.c b/locks/win32/thread_cond.c index f571f9ec9..31a46d54e 100644 --- a/locks/win32/thread_cond.c +++ b/locks/win32/thread_cond.c @@ -20,6 +20,7 @@ #include "apr_strings.h" #include "apr_arch_thread_mutex.h" #include "apr_arch_thread_cond.h" +#include "apr_arch_misc.h" #include "apr_portable.h" #include <limits.h> @@ -79,28 +80,7 @@ static APR_INLINE apr_status_t thread_cond_timedwait(apr_thread_cond_t *cond, apr_thread_mutex_unlock(mutex); do { - apr_interval_time_t t = timeout; - - do { - if (t < 0) { - timeout_ms = INFINITE; - } - else if (t > 0) { - /* Given timeout is 64bit usecs whereas Windows timeouts are - * 32bit msecs and below INFINITE (2^32 - 1), so we may need - * multiple timed out waits... - */ - if (t > apr_time_from_msec(INFINITE - 1)) { - timeout_ms = INFINITE - 1; - t -= apr_time_from_msec(INFINITE - 1); - } - else { - timeout_ms = (DWORD)apr_time_as_msec(t); - t = 0; - } - } - res = WaitForSingleObject(cond->semaphore, timeout_ms); - } while (res == WAIT_TIMEOUT && t > 0); + res = apr_wait_for_single_object(cond->semaphore, timeout); EnterCriticalSection(&cond->csection); |