multi threading library
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. Bait and Commanders are shared though, so you can throw hooks from 1 thread to another.
Example:
1local yarn = require 'yarn'
2
3-- calling t will run the yarn thread.
4local t = yarn.thread(print)
5t 'printing from another lua state!'
thread(fun) -> @Thread | Creates a new, fresh Yarn thread. |
Creates a new, fresh Yarn thread.fun
is the function that will run in the thread.
This function has no parameters.
Want to help improve this page? Create an issue.