[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Turing-incomplete Lua?
- From: David Given <dg@...>
- Date: Wed, 8 Dec 2004 10:37:23 +0000
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-+
| email@example.com | "All power corrupts, but we need electricity." ---
| (firstname.lastname@example.org) | Diana Wynne Jones, _Archer's Goon_
+- www.cowlark.com --+