aboutsummaryrefslogtreecommitdiff
path: root/ldo.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-03-23 11:26:12 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2009-03-23 11:26:12 -0300
commit6d0ae11c576106b490a53215c3f227b65ace2776 (patch)
treefcb09763cf7f81036ed277e65dc5c967d77deef4 /ldo.c
parent3ca739b418243544ecc1098e34c71f2378bad915 (diff)
downloadlua-6d0ae11c576106b490a53215c3f227b65ace2776.tar.gz
lua-6d0ae11c576106b490a53215c3f227b65ace2776.tar.bz2
lua-6d0ae11c576106b490a53215c3f227b65ace2776.zip
'context' added to suspendable calls
Diffstat (limited to 'ldo.c')
-rw-r--r--ldo.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/ldo.c b/ldo.c
index bf21e609..b89a2919 100644
--- a/ldo.c
+++ b/ldo.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: ldo.c,v 2.54 2009/03/04 13:32:29 roberto Exp roberto $ 2** $Id: ldo.c,v 2.55 2009/03/10 17:14:37 roberto Exp roberto $
3** Stack and Call structure of Lua 3** Stack and Call structure of Lua
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -385,7 +385,7 @@ void luaD_call (lua_State *L, StkId func, int nResults, int allowyield) {
385 385
386static void finishCcall (lua_State *L) { 386static void finishCcall (lua_State *L) {
387 int n; 387 int n;
388 lua_assert(L->ci->u.c.cont != NULL); /* must have a continuation */ 388 lua_assert(L->ci->u.c.k != NULL); /* must have a continuation */
389 lua_assert(L->nny == 0); 389 lua_assert(L->nny == 0);
390 /* finish 'luaD_call' */ 390 /* finish 'luaD_call' */
391 G(L)->nCcalls--; 391 G(L)->nCcalls--;
@@ -393,7 +393,7 @@ static void finishCcall (lua_State *L) {
393 adjustresults(L, (L->ci + 1)->nresults); 393 adjustresults(L, (L->ci + 1)->nresults);
394 /* call continuation function */ 394 /* call continuation function */
395 lua_unlock(L); 395 lua_unlock(L);
396 n = (*L->ci->u.c.cont)(L); 396 n = (*L->ci->u.c.k)(L);
397 lua_lock(L); 397 lua_lock(L);
398 /* finish 'luaD_precall' */ 398 /* finish 'luaD_precall' */
399 luaD_poscall(L, L->top - n); 399 luaD_poscall(L, L->top - n);
@@ -477,7 +477,6 @@ LUA_API int lua_resume (lua_State *L, int nargs) {
477 return status; 477 return status;
478} 478}
479 479
480
481LUA_API int lua_yield (lua_State *L, int nresults) { 480LUA_API int lua_yield (lua_State *L, int nresults) {
482 luai_userstateyield(L, nresults); 481 luai_userstateyield(L, nresults);
483 lua_lock(L); 482 lua_lock(L);