diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2008-02-25 11:33:57 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2008-02-25 11:33:57 -0300 |
| commit | 7316d61a66a3dda73009d9bcf9b1bc63351b3563 (patch) | |
| tree | b35fa3bd1e56640dba208fbc230130c6bf1446a1 | |
| parent | e2b366c7601aeecda04f3b7ac5a2bd6eb80521bb (diff) | |
| download | lua-7316d61a66a3dda73009d9bcf9b1bc63351b3563.tar.gz lua-7316d61a66a3dda73009d9bcf9b1bc63351b3563.tar.bz2 lua-7316d61a66a3dda73009d9bcf9b1bc63351b3563.zip | |
'coroutine.running' should work for the main thread too
| -rw-r--r-- | lbaselib.c | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -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 | ||
| 585 | static int luaB_corunning (lua_State *L) { | 585 | static 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 | ||
