diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-07-06 13:54:01 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2020-07-06 13:54:01 -0300 |
commit | d39ea8b3ce684728c1ad5005192766d39d2e8baa (patch) | |
tree | a6366af9c0fb14af5b244b609cbc3da2b652b798 /lstate.c | |
parent | 6298903e35217ab69c279056f925fb72900ce0b7 (diff) | |
download | lua-d39ea8b3ce684728c1ad5005192766d39d2e8baa.tar.gz lua-d39ea8b3ce684728c1ad5005192766d39d2e8baa.tar.bz2 lua-d39ea8b3ce684728c1ad5005192766d39d2e8baa.zip |
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'.
Diffstat (limited to 'lstate.c')
-rw-r--r-- | lstate.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -395,6 +395,7 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) { | |||
395 | g->allgc = obj2gco(L); /* by now, only object is the main thread */ | 395 | g->allgc = obj2gco(L); /* by now, only object is the main thread */ |
396 | L->next = NULL; | 396 | L->next = NULL; |
397 | g->Cstacklimit = L->nCcalls = LUAI_MAXCSTACK + CSTACKERR; | 397 | g->Cstacklimit = L->nCcalls = LUAI_MAXCSTACK + CSTACKERR; |
398 | incnny(L); /* main thread is always non yieldable */ | ||
398 | g->frealloc = f; | 399 | g->frealloc = f; |
399 | g->ud = ud; | 400 | g->ud = ud; |
400 | g->warnf = NULL; | 401 | g->warnf = NULL; |