[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Using debug.sethook() across coroutines
- From: Tysen Moore <tsmoore248@...>
- Date: Fri, 15 Feb 2013 23:06:23 -0500
I think I may have found a solution to my problem, it seems to work for the simple use case. However, I was still curious if this was expected behaviour for
coroutines? Also, does my solution seem reasonable?
debug.sethook(covHandler, "l" )
local oldCreate = coroutine.create
coroutine.create = function( coFunct )
local callback, opt = debug.gethook()
return oldCreate( function()
debug.sethook(callback, opt )
BTW: This is with Lua 5.1.4, not sure if this changed in 5.2.