From 2e32dbe9b5a9f93cda405e9b21701889552783ab Mon Sep 17 00:00:00 2001 From: Graham Leggett Date: Thu, 27 Aug 2009 21:44:48 +0000 Subject: [PATCH] When attempting to set the stale lock, we will pass try_lock twice. If we already have the lock the first time, we must also have the lock the second time. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@808649 13f79535-47bb-0310-9956-ffa450edef68 --- modules/cache/cache_util.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/cache/cache_util.c b/modules/cache/cache_util.c index e287553ccd..73cf7b8951 100644 --- a/modules/cache/cache_util.c +++ b/modules/cache/cache_util.c @@ -195,12 +195,19 @@ CACHE_DECLARE(apr_status_t) ap_cache_try_lock(cache_server_conf *conf, apr_finfo_t finfo; finfo.mtime = 0; apr_file_t *lockfile; + void *dummy; if (!conf || !conf->lock || !conf->lockpath) { /* no locks configured, leave */ return APR_SUCCESS; } + /* lock already obtained earlier? if so, success */ + apr_pool_userdata_get(&dummy, CACHE_LOCKFILE_KEY, r->pool); + if (dummy) { + return APR_SUCCESS; + } + /* create the key if it doesn't exist */ if (!key) { cache_generate_key(r, r->pool, &key); -- 2.40.0