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

Developer

API Reference

ILUA_NEWTHREAD()

Brew Release
Brew MP 1.0.2
See Also
ILua_Release(), ILua_XMove(), ILua_Yield(), ILua_Resume(), ILua_GetStatus()
Description
Creates and pushes on the stack a new Lua thread. The state of the new thread shares all global objects, such as tables, with the original state but has an independent execution stack.
Params
pif
[]:
a pointer to the ILua object
ppiLuaThread
[]:
A new ILua pointer that represents this new thread. All of the interface methods will work with this thread pointer as if it was a separate state.
Interface
Prototype
  •    AEEResult ILua_NewThread(ILua *pif, ILua **ppiLuaThread)
    
Return
  • AEE_SUCCESS if the function succeeded, otherwise an error code.
Side Effect
  • The pointer returned may be released. However, the thread itself may remain subject to garbage collection like any Lua object, which may result in a dangling ILua state pointer. Care should be taken to make sure that there is a Lua reference to this thread while the C interface pointer is being used.