Function ecs_table_lock

Synopsis

#include <include/flecs.h>

FLECS_API void ecs_table_lock(ecs_world_t *world, ecs_table_t *table)

Description

Lock or unlock table. When a table is locked, modifications to it will trigger an assert. When the table is locked recursively, it will take an equal amount of unlock operations to actually unlock the table.

Table locks can be used to build safe iterators where it is guaranteed that the contents of a table are not modified while it is being iterated.

The operation only works when called on the world, and has no side effects when called on a stage. The assumption is that when called on a stage, operations are deferred already.

Parameters

world - The world.

table - The table to lock.

Source

Line 3431 in include/flecs.h.