Function ecs_write_begin

Synopsis

#include <include/flecs.h>

FLECS_API ecs_record_t * ecs_write_begin(ecs_world_t *world, ecs_entity_t entity)

Description

Begin exclusive write access to entity. This operation provides safe exclusive access to the components of an entity without the overhead of deferring operations.

When this operation is called simultaneously for the same entity more than once it will throw an assert. Note that for this to happen, asserts must be enabled. It is up to the application to ensure that access is exclusive, for example by using a read-write mutex.

Exclusive access is enforced at the table level, so only one entity can be exclusively accessed per table. The exclusive access check is thread safe.

This operation must be followed up with ecs_write_end.

Parameters

world - The world.

entity - The entity.

Returns
A record to the entity.

Source

Line 1979 in include/flecs.h.