[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Is this a scoping issue?
- From: Lee Smith <wink@...>
- Date: Thu, 16 Mar 2006 13:05:48 -0600
I should also note, that this appears to function just fine when all the
code is in one file. Although the differences there could be that in my
actual application I'm using lua_dobuffer to load the chunks, and in my
little proof of concept application I'm using lua_dofile.
Shouldn't you be calling yield() instead of resume(co)?
"Help I suffer from the oxymoron Corporate Security."
-------- Original Message --------
Subject: Is this a scoping issue?
From: Lee Smith <email@example.com>
Date: Thu, March 16, 2006 11:41 am
I'm having some problems with a coroutine I create. Here is the order
I create a lua_State and load 3 files into it, each containing its own
function as follows:
co = coroutine.create(process)
print "yielding the coroutine"
print "running again"
Now, when I make a lua_pcall to init, the coroutine starts the process
function just like I would expect. Once it yields, I run off and do
some stuff in my c code, and then pcall callback to wake the coroutine
back up. However the call to resume is failing. Here is my output:
yielding the coroutine
c++ - doing some work
false cannot resume non-suspended coroutine
Any ideas as to where I've gone wrong?