lowk.thread.create
Signature
function lowk.thread.create (
| lpThreadAttributes | [in, optional] | SECURITY_ATTRIBUTES* |
| dwStackSize | [in] | unsigned long long |
| dwCreationFlags | [in] | THREAD_CREATION_FLAGS |
| code | [in] | string | function |
| ... | [in] | any[] |
) -> h: HANDLE, threadid: integer
Runs the given code in another thread.
The first three options and both return values have same meaning as in the CreateThread function.
A new Lua virtual machine is created in the new thread, and the code is run there. Therefore no VM-specific state can be shared between these two threads.
All additional parameters after code are passed to the function in the new thread,
which can access them using the ... (ellipsis) Lua keyword.