lua-users home
lua-l archive

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


Hi,

> I've just got it compiled and running; I had to modify Lua.h a little, as
> there seems to be some problem with the l_s() macro not being defined for
> lthreads.c, which causes errors when using lua_ref() macro.  I presume
> it needs to define LUA_PRIVATE, though that would prevent any libraries
> from creating static strings from C code to pass to Lua unless they too
> were defined with LUA_PRIVATE.

I have seen warnings related to that, but never errors. Anyway, this is
something that will surely be fixed in the official Lua release (remember
we are using the work version).

> One small problem I've come across, when breaking the example child/parent
> flood, it takes two breaks (ctrl-c)... one kills one thread, but the other
> thread continues.  Probably best if the break killed the process, having
> a thread quit by the user would be quite difficult to deal with gracefully.

This is  nothing related to  LuaThreads itself. In your  application, if
you  do not  handle ctrl+c,  the complete  process will  be killed.  Lua
stand-alone interpreter, however, redefines  the signal handler. The new
handler,  when 'called',  arranges for  lua_error to  be called  with na
elegant message and restores the  default handler. Lua_error then aborts
only one  of the threads (who  know which), consuming the  first ctrl+c.
The second ctrl+c goes to  the default handler, which effectively aborts
the  program. Those  of us  that are  annoyed by  this issue  can change
lua.c, but I wouldn't bother.

Regards,
Diego.