aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2004-06-17 11:25:31 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2004-06-17 11:25:31 -0300
commit359840c2f801aa7dd5044c023bf86015ff4e8eef (patch)
treef6416752e9effc8c09f2c742f58f5ae772ded29f
parentdba17070ac2a6a54079b0b935635377545a3b764 (diff)
downloadlua-359840c2f801aa7dd5044c023bf86015ff4e8eef.tar.gz
lua-359840c2f801aa7dd5044c023bf86015ff4e8eef.tar.bz2
lua-359840c2f801aa7dd5044c023bf86015ff4e8eef.zip
new coroutines inherit hook from creator
-rw-r--r--lstate.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lstate.c b/lstate.c
index f8f3f148..0c7ca889 100644
--- a/lstate.c
+++ b/lstate.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstate.c,v 2.8 2004/06/02 19:09:36 roberto Exp roberto $ 2** $Id: lstate.c,v 2.9 2004/06/17 14:06:52 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*/
@@ -139,6 +139,10 @@ lua_State *luaE_newthread (lua_State *L) {
139 preinit_state(L1, G(L)); 139 preinit_state(L1, G(L));
140 stack_init(L1, L); /* init stack */ 140 stack_init(L1, L); /* init stack */
141 setobj2n(L, gt(L1), gt(L)); /* share table of globals */ 141 setobj2n(L, gt(L1), gt(L)); /* share table of globals */
142 L1->hookmask = L->hookmask;
143 L1->basehookcount = L->basehookcount;
144 L1->hook = L->hook;
145 resethookcount(L1);
142 lua_assert(iswhite(obj2gco(L1))); 146 lua_assert(iswhite(obj2gco(L1)));
143 return L1; 147 return L1;
144} 148}