[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 12:33:28 +0000
> -----Original Message-----
> From: firstname.lastname@example.org [mailto:email@example.com] On
> Behalf Of Oliver Kroth
> Sent: woensdag 16 juli 2014 12:34
> To: firstname.lastname@example.org
> Subject: Re: How can I do sethook() to all coroutines of a Lua state?
> Thank you Thijs,
> it's unfortunately not only for debug purposes.
> But I could bypass the problem by finding the main thread of the Lua
> state and hooking the stop function there.
> As it is the central 'player' in COPAS (every other thread yield()s back
> to it and it resume()s to the next thread), it will stumble upon the
> hook anyway.
> Am 16.07.2014 11:40, schrieb Thijs Schreijer:
> > For debug purposes, monkey patch the coroutine table functions, to
> > store all generated coroutines in a weak table in the registry. Thijs
It will work for all operations, not just debug. But monkey patching is considered harmful around here. But if it works for you, nobody is stopping you from doing so. What do you want to accomplish with the debughooks?