[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: How can I do sethook() to all coroutines of a Lua state?
- From: Thijs Schreijer <thijs@...>
- Date: Wed, 16 Jul 2014 09:40:37 +0000
> -----Original Message-----
> From: firstname.lastname@example.org [mailto:email@example.com] On
> Behalf Of Oliver Kroth
> Sent: woensdag 16 juli 2014 10:48
> To: firstname.lastname@example.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?
For debug purposes, monkey patch the coroutine table functions, to store all generated coroutines in a weak table in the registry.