> "The main limitation of Lua coroutines is that, since they are implemented with setjmp(3) and longjmp(3), you cannot use them to call from Lua into C code that calls back into Lua that calls back into C, because the nested longjmp will clobber the C function’s stack frames. (This is detected at runtime, rather than failing silently.)"
Lua 5.2 provides a mechanism to help with this: http://www.lua.org/manual/5.2/manual.html#4.7