lua-users home
lua-l archive

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


> -----Original Message-----
> From: lua-l-bounces@lists.lua.org [mailto:lua-l-bounces@lists.lua.org] On
> Behalf Of Oliver Kroth
> Sent: woensdag 16 juli 2014 10:48
> To: lua-l@lists.lua.org
> Subject: How can I do sethook() to all coroutines of a Lua state?
> 
> I have an (Lua) script that (successfully) uses COPAS to run several
> threads using TCP/IP.
> However, when I try to stop the scipt with the mehtod of lua.c by
> hooking an error-generating function, only one thread is stopped.
> The other threads continue on their own. Quite puzzling...
> I found that each thread has its own hook point, so I am ready to hook
> them all up,
> but I haven't figured out yet how to access them (iterate over them).
> 
> Does anyone know how?
> --
> Oliver

For debug purposes, monkey patch the coroutine table functions, to store all generated coroutines in a weak table in the registry.

Thijs