aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lstate.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/lstate.h b/lstate.h
index b5ac89c2..70cf52ba 100644
--- a/lstate.h
+++ b/lstate.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstate.h,v 2.127 2015/11/02 16:01:41 roberto Exp roberto $ 2** $Id: lstate.h,v 2.128 2015/11/13 12:16:51 roberto Exp roberto $
3** Global State 3** Global State
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -33,6 +33,15 @@
33struct lua_longjmp; /* defined in ldo.c */ 33struct lua_longjmp; /* defined in ldo.c */
34 34
35 35
36/*
37** Atomic type (relative to signals) to better ensure that 'lua_sethook'
38** is thread safe
39*/
40#if !defined(l_signalT)
41#include <signal.h>
42#define l_signalT sig_atomic_t
43#endif
44
36 45
37/* extra stack space to handle TM calls and some other extras */ 46/* extra stack space to handle TM calls and some other extras */
38#define EXTRA_STACK 5 47#define EXTRA_STACK 5
@@ -169,7 +178,7 @@ struct lua_State {
169 int hookcount; 178 int hookcount;
170 unsigned short nny; /* number of non-yieldable calls in stack */ 179 unsigned short nny; /* number of non-yieldable calls in stack */
171 unsigned short nCcalls; /* number of nested C calls */ 180 unsigned short nCcalls; /* number of nested C calls */
172 lu_byte hookmask; 181 l_signalT hookmask;
173 lu_byte allowhook; 182 lu_byte allowhook;
174}; 183};
175 184