lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Feb 20, 2010, at 5:35 AM, Roman Senuta wrote:

> Is it safe to use lua_pcall with non main thread context? Here is the sample code:
> lua_State* L1 = lua_newthread(L);
> ...
> lua_getglobal(L1, "foo");
> lua_pcall(L1, 0, 0, 0);
> 
> Or functions can be executed within created threads only by using lua_resume?

It is safe, with some caveats of course. I asked a similar question recently; see:
http://lua-users.org/lists/lua-l/2010-02/msg00527.html

e