diff --git a/src/hlua.c b/src/hlua.c index d5d07de34..81750564b 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -98,7 +98,7 @@ * because they must be exists in the program stack when the longjmp * is called. */ -jmp_buf safe_ljmp_env; +THREAD_LOCAL jmp_buf safe_ljmp_env; static int hlua_panic_safe(lua_State *L) { return 0; } static int hlua_panic_ljmp(lua_State *L) { longjmp(safe_ljmp_env, 1); } diff --git a/src/hlua_fcn.c b/src/hlua_fcn.c index a5cae8676..a4adb2178 100644 --- a/src/hlua_fcn.c +++ b/src/hlua_fcn.c @@ -40,7 +40,7 @@ static int class_regex_ref; #define STATS_LEN (MAX((int)ST_F_TOTAL_FIELDS, (int)INF_TOTAL_FIELDS)) -static struct field stats[STATS_LEN]; +static THREAD_LOCAL struct field stats[STATS_LEN]; int hlua_checkboolean(lua_State *L, int index) {