3.5 Coroutines

QtLua supports lua coroutines since version 2.

Coroutines can be created from C++ code using the Value::new_thread function.

C++ callable UserData based classes can request yield on return by invoking the UserData::yield function from their reimplementation of the UserData::meta_call function.

Resuming a coroutines from C++ use the same method as function call operation on the Value object. This way you can use the ValueBase::call function and related () operators on a Value object without first checking if it is a regular lua function, a callable UserData based object or a lua coroutine to resume.

Valid XHTML 1.0 StrictGenerated by diaxen on Sat Mar 30 15:29:54 2013 using MkDoc