Skip to main content

create

Function create 

Source
pub fn create(f: function) -> thread
Expand description

Creates a new coroutine with body f, which must be a function. Returns the new coroutine, an object with type "thread".

§Examples

local co = coroutine.create(function() end)
print(co)          --> thread: 0x...
print(type(co))    --> thread