lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Friday, January 25, 2013 11:39:12 AM chuang wrote:
> I try to use  co-routines to simulate "pause" a script and wait until some
> processing is done before resuming,the C and Lua code is below, but it
> cannot work:
> 
> In Lua 5.1.4,when call lua_yield(),it thow "attempt to yield across
> metamethod/C-call boundary" error and return,so when call lua_resume in C
> it fails, how to fix it?

Use Lua 5.2. I never really got how lua_yield/lua_resume were supposed to work 
in 5.1. Now you just pass a continuation function to lua_yield.

-- 
tom <telliamed@whoopdedo.org>