You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Could you please help me for "attempt to yield across C-call boundary" ?
Luajit 2.1.0 beta3 + kaguya:
1.create a coroutine in C by newThread
2. run a lua function with corutine.yield()
3. error:
attempt to yield across C-call boundary
kaguya::LuaThread cor = state.newThread();
state("corfun = function(arg)"
"coroutine.yield(arg) "
"coroutine.yield(arg2) "
"coroutine.yield(arg3) "
"return arg*4 "
" end");//define corouine function
kaguya::LuaFunction corfun = state["corfun"];//lua function get
//exec coroutine with function and argment
std::cout << int(cor(corfun, 3)) << std::endl;//3
std::cout << int(cor()) << std::endl;//6
//resume template argument is result type
std::cout << cor.resume() << std::endl;//9
std::cout << int(cor()) << std::endl;//12
kaguya::LuaThread cor2 = state.newThread();
//3,6,9,12,
while(!cor2.isThreadDead()) <=====cor2.isThreadDead() is true
{
}
The text was updated successfully, but these errors were encountered: