Derived member functions as coroutines

Matt Spong <[email protected]> Thu, 23 Jun 2011 12:39:37 -0400
Newsgroups gmane.comp.lang.lua.bind.user
Message-ID <[email protected]>
I have an abstract base class which I am deriving from in Lua and
overriding virtual functions, using wrap_base as described in the
documentation.

Where I run into problems is calling the derived members as coroutines:

luabind::object self; // this gets passed to wrapper's constructor by
derived class's __init

luabind::object func = self["foo"];
luabind::resume_function<void>(func, self);

This all appears to work properly until the coroutine calls yield().
When this happens, lua_status() returns 0 rather than LUA_YIELD, so my
scheduler decides the coroutine has exited and drops it.

Is this a bug in luabind or am I doing something incorrectly?

Matt

------------------------------------------------------------------------------
Simplify data backup and recovery for your virtual environment with vRanger.
Installation's a snap, and flexible recovery options mean your data is safe,
secure and there when you need it. Data protection magic?
Nope - It's vRanger. Get your free trial download today.
http://p.sf.net/sfu/quest-sfdev2dev