mirror of
https://github.com/lua/lua
synced 2024-11-22 21:01:26 +03:00
extra space for new threads is initialized with a copy of the main
thread, not of the creator thread.
This commit is contained in:
parent
baa0e23456
commit
57d8424146
5
lstate.c
5
lstate.c
@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lstate.c,v 2.123 2014/07/18 13:36:14 roberto Exp roberto $
|
||||
** $Id: lstate.c,v 2.124 2014/07/24 14:00:16 roberto Exp roberto $
|
||||
** Global State
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@ -270,7 +270,8 @@ LUA_API lua_State *lua_newthread (lua_State *L) {
|
||||
L1->hook = L->hook;
|
||||
resethookcount(L1);
|
||||
/* initialize L1 extra space */
|
||||
memcpy(lua_getextraspace(L1), lua_getextraspace(L), LUA_EXTRASPACE);
|
||||
memcpy(lua_getextraspace(L1), lua_getextraspace(g->mainthread),
|
||||
LUA_EXTRASPACE);
|
||||
luai_userstatethread(L, L1);
|
||||
stack_init(L1, L); /* init stack */
|
||||
lua_unlock(L);
|
||||
|
Loading…
Reference in New Issue
Block a user