:param SQInteger initialstacksize:the size of the stack in slots(number of objects)
:returns: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.
creates a new vm friendvm of the one passed as first parmeter and pushes it in its stack as "thread" object.
:param SQUserPointer p:The pointer that has to be set
Sets the foreign pointer of a certain VM instance. The foreign pointer is an arbitrary user defined pointer associated to a VM (by default is value id 0). This pointer is ignored by the VM.
:param SQUserPointer p:The pointer that has to be set
Sets the shared foreign pointer. The foreign pointer is an arbitrary user defined pointer associated to a group of friend VMs (by default is value id 0). After a "main" VM is created using sq_open() all friend VMs created with sq_newthread share the same shared pointer.
:param SQRELESEHOOK hook:The hook that has to be set
Sets the release hook of a certain VM group. The release hook is invoked when the last vm of the group vm is destroyed (usually when sq_close() is invoked). The userpointer passed to the function is the shared foreignpointer(see sq_getsharedforeignptr()). After a "main" VM is created using sq_open() all friend VMs created with sq_newthread() share the same shared release hook.
Sets the release hook of a certain VM instance. The release hook is invoked when the vm is destroyed. The userpointer passed to the function is the vm foreignpointer (see sq_setforeignpointer())
:returns:an SQRESULT(that has to be returned by a C function)
:remarks:sq_result can only be called as return expression of a C function. The function will fail is the suspension is done through more C calls or in a metamethod.
:param SQBool resumedret:if true the function will pop a value from the stack and use it as return value for the function that has previously suspended the virtual machine.
:param SQBool retval:if true the function will push the return value of the function that suspend the excution or the main function one.
:param SQBool raiseerror:if true, if a runtime error occurs during the execution of the call, the vm will invoke the error handler.
:param SQBool throwerror:if true, the vm will thow an exception as soon as is resumed. the exception payload must be set beforehand invoking sq_thowerror().