sq_newthread

Squirrel 3.0

sq_newthread

HSQUIRRELVM sq_newthread(HSQUIRRELVM friendvm, SQInteger initialstacksize);

creates a new vm friendvm of the one passed as first parmeter and pushes it in its stack as "thread" object.

parameters:
HSQUIRRELVM friendvm

a friend VM

SQInteger initialstacksize

the size of the stack in slots(number of objects)

return:

a pointer to the new VM.

remarks:

By default the roottable is shared with the VM passed as first parameter. The new VM lifetime is bound to the "thread" object pushed in the stack and behave like a normal squirrel object.