--- title: thread - Coroutines summary: A Lua thread is a coroutine, not an operating-system thread. Verify availability and permitted use in the X4 UI environment. Coroutines do not authorize engine calls from another OS thread. section: reference kind: guide status: reference updated: 2026-10-26 tags: ["API","X4"] sources: ["https://wiki.egosoft.com/X4%20Foundations%20Wiki/Modding%20Support/","https://www.lua.org/manual/5.1/manual.html","https://luajit.org/ext_ffi_api.html"] --- ## Meaning A Lua thread is a coroutine, not an operating-system thread. Verify availability and permitted use in the X4 UI environment. Coroutines do not authorize engine calls from another OS thread. ## Example ```lua local function describe(value) return type(value) end ``` **What happens:** Only describe is declared; this fragment does not create a coroutine. This fragment does not print or write a log message. The values shown are the expected results of the example. ## Methods and related calls [API reference](wiki:api-index).