mirror of
https://github.com/Hilbis/Hilbish
synced 2025-07-02 01:02:03 +00:00
986 B
986 B
title | description | layout | menu | ||||
---|---|---|---|---|---|---|---|
Module yarn | multi threading library | doc |
|
Introduction
Yarn is a simple multithreading library. Threads are individual Lua states, so they do NOT share the same environment as the code that runs the thread.
Example:
local yarn = require 'yarn'
-- calling t will run the yarn thread.
local t = yarn.thread(print)
t 'printing from another lua state!'
Functions
thread(fun) -> @Thread | Creates a new, fresh Yarn thread. |
yarn.thread(fun) -> Thread
Creates a new, fresh Yarn thread.
fun
is the function that will run in the thread.
Parameters
This function has no parameters.