aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2008-02-25 11:33:57 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2008-02-25 11:33:57 -0300
commit7316d61a66a3dda73009d9bcf9b1bc63351b3563 (patch)
treeb35fa3bd1e56640dba208fbc230130c6bf1446a1
parente2b366c7601aeecda04f3b7ac5a2bd6eb80521bb (diff)
downloadlua-7316d61a66a3dda73009d9bcf9b1bc63351b3563.tar.gz
lua-7316d61a66a3dda73009d9bcf9b1bc63351b3563.tar.bz2
lua-7316d61a66a3dda73009d9bcf9b1bc63351b3563.zip
'coroutine.running' should work for the main thread too
-rw-r--r--lbaselib.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/lbaselib.c b/lbaselib.c
index a2d9cbb9..44329856 100644
--- a/lbaselib.c
+++ b/lbaselib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lbaselib.c,v 1.204 2008/02/14 16:03:09 roberto Exp roberto $ 2** $Id: lbaselib.c,v 1.205 2008/02/19 18:54:09 roberto Exp roberto $
3** Basic library 3** Basic library
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -583,9 +583,9 @@ static int luaB_costatus (lua_State *L) {
583 583
584 584
585static int luaB_corunning (lua_State *L) { 585static int luaB_corunning (lua_State *L) {
586 if (lua_pushthread(L)) 586 int ismain = lua_pushthread(L);
587 lua_pushnil(L); /* main thread is not a coroutine */ 587 lua_pushboolean(L, ismain);
588 return 1; 588 return 2;
589} 589}
590 590
591 591