allow coroutine.corunning to return the main thread
http://lua-users.org/lists/lua-l/2006-09/msg00751.html
This commit is contained in:
@@ -585,10 +585,8 @@ static int luaB_costatus (lua_State *L) {
|
|||||||
|
|
||||||
|
|
||||||
static int luaB_corunning (lua_State *L) {
|
static int luaB_corunning (lua_State *L) {
|
||||||
if (lua_pushthread(L))
|
lua_pushthread(L);
|
||||||
return 0; /* main thread is not a coroutine */
|
return 1;
|
||||||
else
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user