#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
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;
/*
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 "
/* 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 */
/* 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) {
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 "
}
/* 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);