task.synchronize / task.desynchronize
Compatibility no-ops that return immediately.
Syntax
task.synchronize() -> nil
task.desynchronize() -> nil
Parameters
This function takes no parameters.
Returns
| Type | Description |
|---|---|
| - | No return value. |
Description
Scripts in the external VM run on one Lua state, so there is no parallel executor phase to switch into or out of.
Both functions are provided so defensive Luau scripts that wrap parallel work do not error on load.
Example
task.synchronize()
print("still running on the script thread")
task.desynchronize()
Notes
task.spawn— Still yields to a new coroutine; see the task library pages.