Return-Path: X-Original-To: apmail-httpd-cvs-archive@www.apache.org Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AE093DE8F for ; Mon, 6 Aug 2012 09:27:02 +0000 (UTC) Received: (qmail 53613 invoked by uid 500); 6 Aug 2012 09:27:02 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 53269 invoked by uid 500); 6 Aug 2012 09:26:56 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 53235 invoked by uid 99); 6 Aug 2012 09:26:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Aug 2012 09:26:55 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Aug 2012 09:26:54 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id C154C23888E3; Mon, 6 Aug 2012 09:26:10 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1369758 - in /httpd/httpd/trunk/modules/lua: lua_vmprep.c mod_lua.c Date: Mon, 06 Aug 2012 09:26:10 -0000 To: cvs@httpd.apache.org From: humbedooh@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120806092610.C154C23888E3@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: humbedooh Date: Mon Aug 6 09:26:10 2012 New Revision: 1369758 URL: http://svn.apache.org/viewvc?rev=1369758&view=rev Log: use the ap_mutex functions to create the mutex instead of the apr_mutex ones. Modified: httpd/httpd/trunk/modules/lua/lua_vmprep.c httpd/httpd/trunk/modules/lua/mod_lua.c Modified: httpd/httpd/trunk/modules/lua/lua_vmprep.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/lua/lua_vmprep.c?rev=1369758&r1=1369757&r2=1369758&view=diff ============================================================================== --- httpd/httpd/trunk/modules/lua/lua_vmprep.c (original) +++ httpd/httpd/trunk/modules/lua/lua_vmprep.c Mon Aug 6 09:26:10 2012 @@ -14,21 +14,30 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + + #include "mod_lua.h" #include "http_log.h" #include "apr_uuid.h" #include "lua_config.h" #include "apr_file_info.h" #include "mod_auth.h" +#include "util_mutex.h" APLOG_USE_MODULE(lua); #if APR_HAS_THREADS - apr_thread_mutex_t *ap_lua_mutex; + apr_proc_mutex_t *ap_lua_mutex; + +int ap_lua_register_mutex(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp) +{ + ap_mutex_register(p, "lua-shm", NULL, APR_LOCK_DEFAULT, 0); +} + void ap_lua_init_mutex(apr_pool_t *pool, server_rec *s) { - apr_thread_mutex_create(&ap_lua_mutex, APR_THREAD_MUTEX_DEFAULT, pool); + ap_proc_mutex_create(&ap_lua_mutex, NULL, "lua-shm", NULL, s, pool, 0); } #endif @@ -402,7 +411,7 @@ AP_LUA_DECLARE(lua_State*)ap_lua_get_lua ap_lua_server_spec* sspec = NULL; hash = apr_psprintf(r->pool, "reslist:%s", spec->file); #if APR_HAS_THREADS - apr_thread_mutex_lock(ap_lua_mutex); + apr_proc_mutex_lock(ap_lua_mutex); #endif if (apr_pool_userdata_get((void **)&reslist, hash, r->server->process->pool) == APR_SUCCESS) { @@ -427,7 +436,7 @@ AP_LUA_DECLARE(lua_State*)ap_lua_get_lua } } #if APR_HAS_THREADS - apr_thread_mutex_unlock(ap_lua_mutex); + apr_proc_mutex_unlock(ap_lua_mutex); #endif } else { Modified: httpd/httpd/trunk/modules/lua/mod_lua.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/lua/mod_lua.c?rev=1369758&r1=1369757&r2=1369758&view=diff ============================================================================== --- httpd/httpd/trunk/modules/lua/mod_lua.c (original) +++ httpd/httpd/trunk/modules/lua/mod_lua.c Mon Aug 6 09:26:10 2012 @@ -129,6 +129,7 @@ static void ap_lua_release_state(lua_Sta #if APR_HAS_THREADS extern void ap_lua_init_mutex(apr_pool_t *pool, server_rec *s); +extern int ap_lua_register_mutex(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp); #endif static ap_lua_vm_spec *create_vm_spec(apr_pool_t **lifecycle_pool, @@ -1598,6 +1599,7 @@ static void lua_register_hooks(apr_pool_ APR_HOOK_REALLY_FIRST); ap_hook_handler(lua_map_handler, NULL, NULL, AP_LUA_HOOK_FIRST); #if APR_HAS_THREADS + ap_hook_pre_config(ap_lua_register_mutex, NULL, NULL, APR_HOOK_MIDDLE); ap_hook_child_init(ap_lua_init_mutex, NULL, NULL, APR_HOOK_MIDDLE); #endif /* providers */