2
0
Эх сурвалжийг харах

new coroutines inherit hook from creator

Roberto Ierusalimschy 21 жил өмнө
parent
commit
359840c2f8
1 өөрчлөгдсөн 5 нэмэгдсэн , 1 устгасан
  1. 5 1
      lstate.c

+ 5 - 1
lstate.c

@@ -1,5 +1,5 @@
 /*
 /*
-** $Id: lstate.c,v 2.8 2004/06/02 19:09:36 roberto Exp roberto $
+** $Id: lstate.c,v 2.9 2004/06/17 14:06:52 roberto Exp roberto $
 ** Global State
 ** Global State
 ** See Copyright Notice in lua.h
 ** See Copyright Notice in lua.h
 */
 */
@@ -139,6 +139,10 @@ lua_State *luaE_newthread (lua_State *L) {
   preinit_state(L1, G(L));
   preinit_state(L1, G(L));
   stack_init(L1, L);  /* init stack */
   stack_init(L1, L);  /* init stack */
   setobj2n(L, gt(L1), gt(L));  /* share table of globals */
   setobj2n(L, gt(L1), gt(L));  /* share table of globals */
+  L1->hookmask = L->hookmask;
+  L1->basehookcount = L->basehookcount;
+  L1->hook = L->hook;
+  resethookcount(L1);
   lua_assert(iswhite(obj2gco(L1)));
   lua_assert(iswhite(obj2gco(L1)));
   return L1;
   return L1;
 }
 }