diff options
author | Ryan Bloom <rbb@apache.org> | 2001-09-13 02:50:07 +0000 |
---|---|---|
committer | Ryan Bloom <rbb@apache.org> | 2001-09-13 02:50:07 +0000 |
commit | c8712d307f91ec9de7a5bd8b04b5d18765a5b626 (patch) | |
tree | 25a11acbf9a7590e28a4074a1c0bd96eea01f1e0 /locks | |
parent | 13db5d563855d6f8c0dac5a43cab8ff913813ca6 (diff) | |
download | apr-c8712d307f91ec9de7a5bd8b04b5d18765a5b626.tar.gz |
Implement apr_thread_mutex_trylock on Windows
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62318 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'locks')
-rw-r--r-- | locks/win32/thread_mutex.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/locks/win32/thread_mutex.c b/locks/win32/thread_mutex.c index e78ab21f8..86360c36e 100644 --- a/locks/win32/thread_mutex.c +++ b/locks/win32/thread_mutex.c @@ -88,7 +88,12 @@ APR_DECLARE(apr_status_t) apr_thread_mutex_lock(apr_thread_mutex_t *mutex) APR_DECLARE(apr_status_t) apr_thread_mutex_trylock(apr_thread_mutex_t *mutex) { - return APR_ENOTIMPL; + BOOL status; + status = TryEnterCriticalSection(&mutex->section); + if (status) { + return APR_SUCCESS; + } + return APR_EBUSY; } APR_DECLARE(apr_status_t) apr_thread_mutex_unlock(apr_thread_mutex_t *mutex) |