aboutsummaryrefslogtreecommitdiff
path: root/lstate.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-07-06 13:54:01 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-07-06 13:54:01 -0300
commitd39ea8b3ce684728c1ad5005192766d39d2e8baa (patch)
treea6366af9c0fb14af5b244b609cbc3da2b652b798 /lstate.c
parent6298903e35217ab69c279056f925fb72900ce0b7 (diff)
downloadlua-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.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lstate.c b/lstate.c
index 4434211a..b1f487ff 100644
--- a/lstate.c
+++ b/lstate.c
@@ -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;