[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: coroutine.yield from debug hook in LuaJIT 2
- From: Greg <tghill@...>
- Date: Sat, 11 Jun 2011 13:11:03 +0000 (UTC)
Hi,
Is it possible to yield form a coroutine in a debug hook in LuaJIT 2?
Currently, I get the error "attempt to yield across C-call boundary."
I've seen some messages in the past that suggested that this was not possible.
However, I think I was able to do this with LuaJIT 1.x.
Here is some pseudo-code:
function debug_hook(event, line)
coroutine.yield()
end
local func = loadstring(text)
local co = coroutine.create(func)
debug.sethook(co, debug_hook, "l")
coroutine.resume(co)
Any ideas?
- Greg