Threading (thread)
thread
Multi-threading: dispatch tasks, wait, kill, event system for cross-thread communication.
7 functions
Lua 5.3
thread.thread.current_id
thread.current_id()Get current thread ID.
thread.thread.dispatch
thread.dispatch(task [, on_error])Run function in a new thread.
thread.thread.emit_event
thread.emit_event(name, ...)Emit event to all listeners.
thread.thread.kill
thread.kill(tid)Kill a running thread.
thread.thread.register_event
thread.register_event(name, callback [, on_error])Register event listener.
thread.thread.unregister_event
thread.unregister_event(name, eid)Remove event listener.
thread.thread.wait
thread.wait(tid [, timeout])Wait for thread to complete.