From 54f1267c2c87daea769966c694777a2e5977f870 Mon Sep 17 00:00:00 2001 From: kwolekr Date: Sun, 25 Oct 2015 00:45:18 -0400 Subject: SAPI: Mark all Lua API functions requiring envlock --- src/script/lua_api/l_internal.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/script/lua_api/l_internal.h') diff --git a/src/script/lua_api/l_internal.h b/src/script/lua_api/l_internal.h index 1e40c5c4a..456c8fcce 100644 --- a/src/script/lua_api/l_internal.h +++ b/src/script/lua_api/l_internal.h @@ -33,6 +33,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #define API_FCT(name) registerFunction(L, #name, l_##name,top) #define ASYNC_API_FCT(name) engine.registerFunction(#name, l_##name) +#define MAP_LOCK_REQUIRED #define NO_MAP_LOCK_REQUIRED /* @@ -45,4 +46,13 @@ with this program; if not, write to the Free Software Foundation, Inc., #endif */ +#define GET_ENV_PTR_NO_MAP_LOCK \ + ServerEnvironment *env = (ServerEnvironment *)getEnv(L); \ + if (env == NULL) \ + return 0 + +#define GET_ENV_PTR \ + MAP_LOCK_REQUIRED; \ + GET_ENV_PTR_NO_MAP_LOCK + #endif /* L_INTERNAL_H_ */ -- cgit v1.2.3