ecs_table_lock

Function ecs_table_lock 

Source
pub unsafe extern "C" fn ecs_table_lock(
    world: *mut ecs_world_t,
    table: *mut ecs_table_t,
)
Expand description

Lock or unlock table. When a table is locked, modifications to it will throw 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.

@param world The world. @param table The table to lock.