[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: debug.getinfo() - 5.1
- From: roberto@... (Roberto Ierusalimschy)
- Date: Thu, 21 Sep 2006 10:16:57 -0300
> Can I use debug.getinfo to have info on the call stack of the main thread if
> I'm in a another coroutine ?
> It seems that the main thread isn't a couroutine ( coroutine.running returns
> nil in the main frame ) so I don't know how to set the first param of
> getinfo to indicate the main thread...
> Is it possible ? If yes, how ?
This is not possible now :( We probably will change it in 5.2. For now,
you can make the following "fix" in lbaselib.c:
static int luaB_corunning (lua_State *L) {
- if (lua_pushthread(L))
- lua_pushnil(L); /* main thread is not a coroutine */
+ lua_pushthread(L);
return 1;
}
(Then coroutine.running will return the main thread.)
-- Roberto