[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: How to use lua_yield/lua_resume in C correctly?
- From: TNHarris <telliamed@...>
- Date: Sun, 27 Jan 2013 12:41:57 -0500
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.