using 'sig_atomic_t' for 'hookmask' (as it can be changed inside

a signal)
This commit is contained in:
Roberto Ierusalimschy 2015-12-14 09:54:49 -02:00
parent 2d1d57bc18
commit 656b3cea1b

View File

@ -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 <signal.h>
#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;
};