]> granicus.if.org Git - apache/commitdiff
Reverting r1369758
authorDaniel Gruno <humbedooh@apache.org>
Mon, 6 Aug 2012 09:52:50 +0000 (09:52 +0000)
committerDaniel Gruno <humbedooh@apache.org>
Mon, 6 Aug 2012 09:52:50 +0000 (09:52 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1369763 13f79535-47bb-0310-9956-ffa450edef68

modules/lua/lua_vmprep.c
modules/lua/mod_lua.c

index eb9d188f41935ec3882bbc9423d0af96fd851c0c..14ae97bd6dbb4a4d94234be55fee622de67ebcb1 100644 (file)
  * 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_proc_mutex_t *ap_lua_mutex;
-    
+    apr_thread_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) 
 {
-    ap_proc_mutex_create(&ap_lua_mutex, NULL, "lua-shm", NULL, s, pool, 0);
+    apr_thread_mutex_create(&ap_lua_mutex, APR_THREAD_MUTEX_DEFAULT, pool);
 }
 #endif
 
@@ -411,7 +402,7 @@ AP_LUA_DECLARE(lua_State*)ap_lua_get_lua_state(apr_pool_t *lifecycle_pool,
         ap_lua_server_spec* sspec = NULL;
         hash = apr_psprintf(r->pool, "reslist:%s", spec->file);
 #if APR_HAS_THREADS
-        apr_proc_mutex_lock(ap_lua_mutex);
+        apr_thread_mutex_lock(ap_lua_mutex);
 #endif
         if (apr_pool_userdata_get((void **)&reslist, hash,
                                   r->server->process->pool) == APR_SUCCESS) {
@@ -436,7 +427,7 @@ AP_LUA_DECLARE(lua_State*)ap_lua_get_lua_state(apr_pool_t *lifecycle_pool,
             }
         }
 #if APR_HAS_THREADS
-        apr_proc_mutex_unlock(ap_lua_mutex);
+        apr_thread_mutex_unlock(ap_lua_mutex);
 #endif
     }
     else {
index 16bd455b9481a1355003c73a60e572c5830d335e..f72c1dd0aaa14555f9342c8566becbbc592a038d 100644 (file)
@@ -129,7 +129,6 @@ static void ap_lua_release_state(lua_State* L, ap_lua_vm_spec* spec, request_rec
 
 #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,
@@ -1599,7 +1598,6 @@ static void lua_register_hooks(apr_pool_t *p)
                       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 */