lua-users home
lua-l archive

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


On Tuesday 07 December 2004 18:37, Luiz Henrique de Figueiredo wrote:
> > I didn't know it was safe to call lua_sethook from another (OS) thread
> > while a script was running. This is not the same situation as in the
> > vanilla Lua interpreter, or is it?
>
> No, it's not. lua.c calls lua_sethook from a signal handler.

You could always do that, then, if your threads support signals or something 
similar: have a signal handler call lua_sethook, and then when you want to 
terminate the thread, send the signal to the thread. That way all the 
lua_State manipulation takes place in the same thread.

-- 
+- David Given --McQ-+ 
|  dg@cowlark.com    | "All power corrupts, but we need electricity." ---
| (dg@tao-group.com) | Diana Wynne Jones, _Archer's Goon_
+- www.cowlark.com --+