diff --git a/lstate.h b/lstate.h index b5ac89c2..70cf52ba 100644 --- a/lstate.h +++ b/lstate.h @@ -1,5 +1,5 @@ /* -** $Id: lstate.h,v 2.127 2015/11/02 16:01:41 roberto Exp roberto $ +** $Id: lstate.h,v 2.128 2015/11/13 12:16:51 roberto Exp roberto $ ** Global State ** See Copyright Notice in lua.h */ @@ -33,6 +33,15 @@ struct lua_longjmp; /* defined in ldo.c */ +/* +** Atomic type (relative to signals) to better ensure that 'lua_sethook' +** is thread safe +*/ +#if !defined(l_signalT) +#include +#define l_signalT sig_atomic_t +#endif + /* extra stack space to handle TM calls and some other extras */ #define EXTRA_STACK 5 @@ -169,7 +178,7 @@ struct lua_State { int hookcount; unsigned short nny; /* number of non-yieldable calls in stack */ unsigned short nCcalls; /* number of nested C calls */ - lu_byte hookmask; + l_signalT hookmask; lu_byte allowhook; };