From 11ddf3f32d7e58ae8ab5e6c170a401f43bc29c36 Mon Sep 17 00:00:00 2001 From: Brian Pane Date: Sat, 16 Feb 2002 21:57:17 +0000 Subject: [PATCH] Converted the rewrite mapper lock to the new lock API git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93445 13f79535-47bb-0310-9956-ffa450edef68 --- modules/mappers/mod_rewrite.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index 70cc657a1e..7125d7d681 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -93,6 +93,7 @@ #include "apr_user.h" #include "apr_lib.h" #include "apr_signal.h" +#include "apr_proc_mutex.h" #define APR_WANT_STRFUNC #define APR_WANT_IOVEC @@ -186,7 +187,7 @@ static cache *cachep; static int proxy_available; static const char *lockname; -static apr_lock_t *rewrite_mapr_lock_acquire = NULL; +static apr_proc_mutex_t *rewrite_mapr_lock_acquire = NULL; static apr_lock_t *rewrite_log_lock = NULL; /* @@ -977,7 +978,8 @@ static void init_child(apr_pool_t *p, server_rec *s) if (lockname != NULL && *(lockname) != '\0') { - rv = apr_lock_child_init (&rewrite_mapr_lock_acquire, lockname, p); + rv = apr_proc_mutex_child_init(&rewrite_mapr_lock_acquire, + lockname, p); if (rv != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_CRIT, rv, s, "mod_rewrite: could not init rewrite_mapr_lock_acquire " @@ -2929,7 +2931,7 @@ static char *lookup_map_program(request_rec *r, apr_file_t *fpin, /* take the lock */ if (rewrite_mapr_lock_acquire) { - apr_lock_acquire(rewrite_mapr_lock_acquire); + apr_proc_mutex_lock(rewrite_mapr_lock_acquire); } /* write out the request key */ @@ -2964,7 +2966,7 @@ static char *lookup_map_program(request_rec *r, apr_file_t *fpin, /* give the lock back */ if (rewrite_mapr_lock_acquire) { - apr_lock_release(rewrite_mapr_lock_acquire); + apr_proc_mutex_unlock(rewrite_mapr_lock_acquire); } if (strcasecmp(buf, "NULL") == 0) { @@ -3266,8 +3268,8 @@ static void rewritelock_create(server_rec *s, apr_pool_t *p) lockname = ap_server_root_relative(p, lockname); /* create the lockfile */ - rc = apr_lock_create(&rewrite_mapr_lock_acquire, APR_MUTEX, APR_LOCKALL, - APR_LOCK_DEFAULT, lockname, p); + rc = apr_proc_mutex_create(&rewrite_mapr_lock_acquire, lockname, + APR_LOCK_DEFAULT, p); if (rc != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_ERR, rc, s, "mod_rewrite: Parent could not create RewriteLock " @@ -3286,7 +3288,7 @@ static apr_status_t rewritelock_remove(void *data) } /* destroy the rewritelock */ - apr_lock_destroy (rewrite_mapr_lock_acquire); + apr_proc_mutex_destroy (rewrite_mapr_lock_acquire); rewrite_mapr_lock_acquire = NULL; lockname = NULL; return(0); -- 2.40.0