Changes with Apache 2.0.27-dev
+ *) Introduced thread saftey for mod_rewrite's internal cache.
+ [Brian Pane <bpane@pacbell.net>]
+
+ *) Simplified mod_env's directives to behave as most directives are
+ expected, in that UnsetEnv will not unset a SetEnv and PassEnv
+ directive following that UnsetEnv within the same container.
+ Also provides a runtime startup warning if a PassEnv configured
+ environment value is undefined. [William Rowe]
+
*) The worker MPM is now completely ported to APR's new lock API. It
uses native APR types for thread mutexes, cross-process mutexes,
and condition variables. [Aaron Bannert]
if (apr_pool_create(&c->pool, p) != APR_SUCCESS)
return NULL;
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);
+#endif
return c;
}
cachetlbentry *t;
int found_list;
+#if APR_HAS_THREADS
+ apr_lock_acquire(c->lock);
+#endif
+
found_list = 0;
/* first try to edit an existing entry */
for (i = 0; i < c->lists->nelts; i++) {
if (e != NULL) {
e->time = ce->time;
e->value = apr_pstrdup(c->pool, ce->value);
+#if APR_HAS_THREADS
+ apr_lock_release(c->lock);
+#endif
return;
}
if (strcmp(e->key, ce->key) == 0) {
e->time = ce->time;
e->value = apr_pstrdup(c->pool, ce->value);
- cache_tlb_replace((cachetlbentry *)l->tlb->elts,
- (cacheentry *)l->entries->elts, e);
+ cache_tlb_replace((cachetlbentry *)l->tlb->elts,
+ (cacheentry *)l->entries->elts, e);
+#if APR_HAS_THREADS
+ apr_lock_release(c->lock);
+#endif
return;
}
}
e->value = apr_pstrdup(c->pool, ce->value);
cache_tlb_replace((cachetlbentry *)l->tlb->elts,
(cacheentry *)l->entries->elts, e);
+#if APR_HAS_THREADS
+ apr_lock_release(c->lock);
+#endif
return;
}
}
/* not reached, but when it is no problem... */
+#if APR_HAS_THREADS
+ apr_lock_release(c->lock);
+#endif
return;
}
cachelist *l;
cacheentry *e;
+#if APR_HAS_THREADS
+ apr_lock_acquire(c->lock);
+#endif
+
for (i = 0; i < c->lists->nelts; i++) {
l = &(((cachelist *)c->lists->elts)[i]);
if (strcmp(l->resource, res) == 0) {
e = cache_tlb_lookup((cachetlbentry *)l->tlb->elts,
(cacheentry *)l->entries->elts, key);
- if (e != NULL)
+ if (e != NULL) {
+#if APR_HAS_THREADS
+ apr_lock_release(c->lock);
+#endif
return e;
+ }
for (j = 0; j < l->entries->nelts; j++) {
e = &(((cacheentry *)l->entries->elts)[j]);
if (strcmp(e->key, key) == 0) {
+#if APR_HAS_THREADS
+ apr_lock_release(c->lock);
+#endif
return e;
}
}
}
}
+#if APR_HAS_THREADS
+ apr_lock_release(c->lock);
+#endif
return NULL;
}