diff options
author | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2003-02-27 19:20:24 +0000 |
---|---|---|
committer | wrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68> | 2003-02-27 19:20:24 +0000 |
commit | e0ec9dbe4ad48d00f575e0e02dd88f0df1c07abd (patch) | |
tree | f841ac33c1eb6ea965466336ffbabba3d7593a28 /locks | |
parent | 27b50d1f4df34995aaa0f0638ed91788ae805f44 (diff) | |
download | libapr-e0ec9dbe4ad48d00f575e0e02dd88f0df1c07abd.tar.gz |
Fix two problems in apr_thread_cond_timedwait, the first observed by
Ohtani Hiroki <ohtani@ariel-networks.com> that we failed to relock
on failure, and the second problem I found that we weren't returning
an error status when we failed for something other than timeup.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64389 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'locks')
-rw-r--r-- | locks/win32/thread_cond.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/locks/win32/thread_cond.c b/locks/win32/thread_cond.c index 48465cbba..f99b25dd3 100644 --- a/locks/win32/thread_cond.c +++ b/locks/win32/thread_cond.c @@ -142,10 +142,11 @@ APR_DECLARE(apr_status_t) apr_thread_cond_timedwait(apr_thread_cond_t *cond, if (res != WAIT_OBJECT_0) { apr_status_t rv = apr_get_os_error(); ReleaseMutex(cond->mutex); + apr_thread_mutex_lock(mutex); if (res == WAIT_TIMEOUT) { - rv = APR_TIMEUP; + return APR_TIMEUP; } - return rv; + return apr_get_os_error(); } if (cond->signal_all) { if (cond->num_waiting == 0) { |