[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: yield across metamethod/C-call ?
- From: Javier Guerra <javier@...>
- Date: Tue, 16 Feb 2010 12:31:47 -0500
On Tue, Feb 16, 2010 at 11:56 AM, Valerio Schiavoni
<valerio.schiavoni@gmail.com> wrote:
> coroutine.create(coroutine.yield())
as Peter pointed, coroutine.yield() is being called from the main
thread. it tries to yield to the calling function, but that's the
executable environment, which is a C program. that explains the error.
the 'minimal and useless' equivalent code is the one suggested by Michal:
coroutine.create(function() coroutine.yield() end)
here you define an anonymous Lua function that only calls
coroutine.yield(), and gives it to coroutine.create()
--
Javier