FANDOM


ThreadEdit

EssentialsEdit

A thread is similar to a function. It executes the code within. The only difference is that threads are executed concurrently. Threads are created using the coroutine library. For now, we shall refer to threads as coroutines. A coroutine by default is in an idle state. In order to resume it you must pass it to the resume function. You can also check the status of a coroutine. See the Coroutine Library article for more detail.

SamplesEdit

Sample
The following is an example of execution with threads.

Source:

coroutine.resume(coroutine.create(function()
       print('Foo bar')
end))
Output:

Foo bar

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.