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 /test/testlock.c | |
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 'test/testlock.c')
-rw-r--r-- | test/testlock.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/testlock.c b/test/testlock.c index cac60ce0f..6d964f266 100644 --- a/test/testlock.c +++ b/test/testlock.c @@ -408,7 +408,7 @@ apr_status_t test_thread_mutex(void) printf("thread_mutex test\n"); printf("%-60s", " Initializing the mutex"); - s1 = apr_thread_mutex_create(&thread_mutex, pool); + s1 = apr_thread_mutex_create(&thread_mutex, APR_THREAD_MUTEX_DEFAULT, pool); if (s1 != APR_SUCCESS) { printf("Failed!\n"); @@ -505,7 +505,7 @@ apr_status_t test_cond(void) printf("thread_cond Tests\n"); printf("%-60s", " Initializing the first apr_thread_mutex_t"); - s1 = apr_thread_mutex_create(&put.mutex, pool); + s1 = apr_thread_mutex_create(&put.mutex, APR_THREAD_MUTEX_DEFAULT, pool); if (s1 != APR_SUCCESS) { printf("Failed!\n"); return s1; @@ -513,7 +513,7 @@ apr_status_t test_cond(void) printf("OK\n"); printf("%-60s", " Initializing the second apr_thread_mutex_t"); - s1 = apr_thread_mutex_create(&nready.mutex, pool); + s1 = apr_thread_mutex_create(&nready.mutex, APR_THREAD_MUTEX_DEFAULT, pool); if (s1 != APR_SUCCESS) { printf("Failed!\n"); return s1; @@ -579,7 +579,7 @@ apr_status_t test_timeoutcond(void) printf("thread_cond_timedwait Tests\n"); printf("%-60s", " Initializing the first apr_thread_mutex_t"); - s = apr_thread_mutex_create(&timeout_mutex, pool); + s = apr_thread_mutex_create(&timeout_mutex, APR_THREAD_MUTEX_DEFAULT, pool); if (s != APR_SUCCESS) { printf("Failed!\n"); return s; |