diff options
author | Aaron Bannert <aaron@apache.org> | 2002-04-09 06:45:06 +0000 |
---|---|---|
committer | Aaron Bannert <aaron@apache.org> | 2002-04-09 06:45:06 +0000 |
commit | 461f265f2521781c2aa031334db587c9bcbb432a (patch) | |
tree | 2262a87686e0925e7488d3a169904c0674ef4e86 /test/testthread.c | |
parent | 4941cb301a6eac4ad9eba47113856d5020bd1a6c (diff) | |
download | apr-461f265f2521781c2aa031334db587c9bcbb432a.tar.gz |
Remove all uses of the apr_lock.h API from the tests.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63232 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'test/testthread.c')
-rw-r--r-- | test/testthread.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/test/testthread.c b/test/testthread.c index 11749f329..f59cb3a5d 100644 --- a/test/testthread.c +++ b/test/testthread.c @@ -53,7 +53,6 @@ */ #include "apr_thread_proc.h" -#include "apr_lock.h" #include "apr_errno.h" #include "apr_general.h" #include "errno.h" @@ -79,7 +78,7 @@ void * APR_THREAD_FUNC thread_func2(apr_thread_t *thd, void *data); void * APR_THREAD_FUNC thread_func3(apr_thread_t *thd, void *data); void * APR_THREAD_FUNC thread_func4(apr_thread_t *thd, void *data); -apr_lock_t *thread_lock; +apr_thread_mutex_t *thread_lock; apr_pool_t *context; apr_thread_once_t *control = NULL; int x = 0; @@ -98,9 +97,9 @@ void * APR_THREAD_FUNC thread_func1(apr_thread_t *thd, void *data) apr_thread_once(control, init_func); for (i = 0; i < 10000; i++) { - apr_lock_acquire(thread_lock); + apr_thread_mutex_lock(thread_lock); x++; - apr_lock_release(thread_lock); + apr_thread_mutex_unlock(thread_lock); } apr_thread_exit(thd, exit_ret_val); return NULL; @@ -129,8 +128,8 @@ int main(void) apr_thread_once_init(&control, context); printf("%-60s", "Initializing the lock"); - r1 = apr_lock_create(&thread_lock, APR_MUTEX, APR_INTRAPROCESS, - APR_LOCK_DEFAULT, "lock.file", context); + r1 = apr_thread_mutex_create(&thread_lock, APR_THREAD_MUTEX_DEFAULT, + context); if (r1 != APR_SUCCESS) { fflush(stdout); fprintf(stderr, "Failed\nCould not create lock\n"); |