diff options
author | aaron <aaron@13f79535-47bb-0310-9956-ffa450edef68> | 2001-10-17 00:33:00 +0000 |
---|---|---|
committer | aaron <aaron@13f79535-47bb-0310-9956-ffa450edef68> | 2001-10-17 00:33:00 +0000 |
commit | 644984101621c469c255a7682b0252a4997cf660 (patch) | |
tree | 165cda9c95dc0432268a06e5530abc06fa1cf17d /include/apr_thread_mutex.h | |
parent | aa365ec9e3cec131802d732f116932f84c00a827 (diff) | |
download | libapr-644984101621c469c255a7682b0252a4997cf660.tar.gz |
Added a new parameter to apr_thread_mutex_init(). Mutexes are now by
default not nested, but an init flag can enable them. I added a new test
to testlockperf to show how much faster non-nested mutexes are. I also
updated calls to apr_thread_mutex_init() wherever I could find them.
This patch only implements this for Unix (nested locks already existed
on Unix, so this patch just optionally enables/disables them). I did my
best to change the function declaration on other platforms, but someone
will have to double check me. Those other platforms will also have to
either enable nested locks (sometimes available in their thread
library) or just do what Unix does.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@62435 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include/apr_thread_mutex.h')
-rw-r--r-- | include/apr_thread_mutex.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/apr_thread_mutex.h b/include/apr_thread_mutex.h index 6e7b434b3..2861ae0d6 100644 --- a/include/apr_thread_mutex.h +++ b/include/apr_thread_mutex.h @@ -78,13 +78,21 @@ extern "C" { typedef struct apr_thread_mutex_t apr_thread_mutex_t; +#define APR_THREAD_MUTEX_DEFAULT 0x0 +#define APR_THREAD_MUTEX_NESTED 0x1 + /** * Create and initialize a mutex that can be used to synchronize threads. * @param mutex the memory address where the newly created mutex will be * stored. + * @param flags Or'ed value of: + * <PRE> + * APR_THREAD_MUTEX_NESTED enable nested (recursive) locks. + * </PRE> * @param pool the pool from which to allocate the mutex. */ APR_DECLARE(apr_status_t) apr_thread_mutex_create(apr_thread_mutex_t **mutex, + unsigned int flags, apr_pool_t *pool); /** * Acquire the lock for the given mutex. If the mutex is already locked, |