From: Aaron Bannert Date: Wed, 14 Nov 2001 08:03:18 +0000 (+0000) Subject: Convert mod_rewrite's INTRAPROCESS lock to the newly supported X-Git-Tag: 2.0.29~139 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b77471f71c9fb359db79575f8ca9b51fdb18ca5b;p=thirdparty%2Fapache%2Fhttpd.git Convert mod_rewrite's INTRAPROCESS lock to the newly supported apr_thread_mutex_t type lock. Passes all rewrite.t tests. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91941 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index 724b97e6495..825bc53bd69 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -3668,7 +3668,7 @@ static cache *init_cache(apr_pool_t *p) } c->lists = apr_array_make(c->pool, 2, sizeof(cachelist)); #if APR_HAS_THREADS - (void)apr_lock_create(&(c->lock), APR_MUTEX, APR_INTRAPROCESS, NULL, p); + (void)apr_thread_mutex_create(&(c->lock), APR_THREAD_MUTEX_DEFAULT, p); #endif return c; } @@ -3761,7 +3761,7 @@ static void store_cache_string(cache *c, const char *res, cacheentry *ce) int found_list; #if APR_HAS_THREADS - apr_lock_acquire(c->lock); + apr_thread_mutex_lock(c->lock); #endif found_list = 0; @@ -3777,7 +3777,7 @@ static void store_cache_string(cache *c, const char *res, cacheentry *ce) e->time = ce->time; e->value = apr_pstrdup(c->pool, ce->value); #if APR_HAS_THREADS - apr_lock_release(c->lock); + apr_thread_mutex_unlock(c->lock); #endif return; } @@ -3790,7 +3790,7 @@ static void store_cache_string(cache *c, const char *res, cacheentry *ce) cache_tlb_replace((cachetlbentry *)l->tlb->elts, (cacheentry *)l->entries->elts, e); #if APR_HAS_THREADS - apr_lock_release(c->lock); + apr_thread_mutex_unlock(c->lock); #endif return; } @@ -3823,7 +3823,7 @@ static void store_cache_string(cache *c, const char *res, cacheentry *ce) cache_tlb_replace((cachetlbentry *)l->tlb->elts, (cacheentry *)l->entries->elts, e); #if APR_HAS_THREADS - apr_lock_release(c->lock); + apr_thread_mutex_unlock(c->lock); #endif return; } @@ -3831,7 +3831,7 @@ static void store_cache_string(cache *c, const char *res, cacheentry *ce) /* not reached, but when it is no problem... */ #if APR_HAS_THREADS - apr_lock_release(c->lock); + apr_thread_mutex_unlock(c->lock); #endif return; } @@ -3844,7 +3844,7 @@ static cacheentry *retrieve_cache_string(cache *c, const char *res, char *key) cacheentry *e; #if APR_HAS_THREADS - apr_lock_acquire(c->lock); + apr_thread_mutex_lock(c->lock); #endif for (i = 0; i < c->lists->nelts; i++) { @@ -3855,7 +3855,7 @@ static cacheentry *retrieve_cache_string(cache *c, const char *res, char *key) (cacheentry *)l->entries->elts, key); if (e != NULL) { #if APR_HAS_THREADS - apr_lock_release(c->lock); + apr_thread_mutex_unlock(c->lock); #endif return e; } @@ -3864,7 +3864,7 @@ static cacheentry *retrieve_cache_string(cache *c, const char *res, char *key) e = &(((cacheentry *)l->entries->elts)[j]); if (strcmp(e->key, key) == 0) { #if APR_HAS_THREADS - apr_lock_release(c->lock); + apr_thread_mutex_unlock(c->lock); #endif return e; } @@ -3872,7 +3872,7 @@ static cacheentry *retrieve_cache_string(cache *c, const char *res, char *key) } } #if APR_HAS_THREADS - apr_lock_release(c->lock); + apr_thread_mutex_unlock(c->lock); #endif return NULL; } diff --git a/modules/mappers/mod_rewrite.h b/modules/mappers/mod_rewrite.h index 56a85a18016..2470989d4f3 100644 --- a/modules/mappers/mod_rewrite.h +++ b/modules/mappers/mod_rewrite.h @@ -114,6 +114,7 @@ #if APR_HAS_THREADS #include "apr_lock.h" +#include "apr_thread_mutex.h" #endif #include "ap_config.h" @@ -326,7 +327,7 @@ typedef struct cache { apr_pool_t *pool; apr_array_header_t *lists; #if APR_HAS_THREADS - apr_lock_t *lock; + apr_thread_mutex_t *lock; #endif } cache;