Make sure that main thread is non yieldable
Main thread must be non yieldable even at "level 0" (bare API), outside the 'pcall' from 'lua.c'.
This commit is contained in:
1
lstate.c
1
lstate.c
@@ -395,6 +395,7 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) {
|
||||
g->allgc = obj2gco(L); /* by now, only object is the main thread */
|
||||
L->next = NULL;
|
||||
g->Cstacklimit = L->nCcalls = LUAI_MAXCSTACK + CSTACKERR;
|
||||
incnny(L); /* main thread is always non yieldable */
|
||||
g->frealloc = f;
|
||||
g->ud = ud;
|
||||
g->warnf = NULL;
|
||||
|
||||
Reference in New Issue
Block a user