]> granicus.if.org Git - apache/commitdiff
Convert mod_rewrite's INTRAPROCESS lock to the newly supported
authorAaron Bannert <aaron@apache.org>
Wed, 14 Nov 2001 08:03:18 +0000 (08:03 +0000)
committerAaron Bannert <aaron@apache.org>
Wed, 14 Nov 2001 08:03:18 +0000 (08:03 +0000)
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

modules/mappers/mod_rewrite.c
modules/mappers/mod_rewrite.h

index 724b97e6495b241dd63a7461624d813fa1a8fb9d..825bc53bd693f7f27a5bbd68c5d4f2aeeeadd964 100644 (file)
@@ -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;
 }
index 56a85a18016e92f34d4640eb68e25fab0c8a78a7..2470989d4f391a8d0902804cee7ea678b290892e 100644 (file)
 
 #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;