API Reference | developer.brewmp.com API Reference | developer.brewmp.com

Developer

API Reference

ILUA_RESUME()

Brew Release
Brew MP 1.0.2
See Also
ILua_Yield(), ILua_NewThread(), ILua_PCall() return values, ILuaDebug
Description
Starts and resumes a coroutine in a given thread. The thread must be pushed on the stack along with its nNumArgs arguments. The call will return when the coroutine suspends (via ILua_Yield()) or finishes its execution (when the body function returns). In case of errors the stack is not unwound and the ILuaDebug interface can be obtained to inspect it.
Params
pif
[]:
a pointer to the ILua object
nNumArgs
[]:
the number of arguments on the top of the stack above the coroutine thread. In the case of starting a coroutine, these are passed to the function body as arguments, otherwise they are passed as results to yield/ILua_Yield() if the coroutine is being resumed.
Interface
Prototype
  •    int ILua_Resume(ILua *pif, int nNumArgs)
    
Return
  • Returns 0 if the coroutine finishes its execution without errors, ILua_COYIELD if the coroutine yields, or an error code in case of errors.