Skip to content

Commit dd328ea

Browse files
committed
improve docs for api_internal of read/write
1 parent b2ef873 commit dd328ea

1 file changed

Lines changed: 82 additions & 14 deletions

File tree

include/flecs/private/api_internals.h

Lines changed: 82 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -409,108 +409,176 @@ FLECS_ALWAYS_INLINE ecs_table_t *flecs_table_traverse_add(
409409

410410
#ifdef FLECS_MUT_ALIAS_LOCKS
411411

412-
/** Begin read lock on sparse component record.
412+
/** Begin read lock on sparse component record.
413413
* a sparse id is a component marked either as sparse or non-fragmenting
414-
*/
414+
*
415+
* @param cr The component record.
416+
* @return true if the mut alias was violated, false otherwise.
417+
*/
415418
FLECS_API
416419
FLECS_ALWAYS_INLINE bool flecs_sparse_id_record_lock_read_begin(
417420
ecs_component_record_t *cr);
418421

419422
/** End read lock on sparse component record.
420423
* a sparse id is a component marked either as sparse or non-fragmenting
424+
*
425+
* @param cr The component record.
426+
* @return true if the mut alias was violated, false otherwise.
421427
*/
422428
FLECS_API
423429
FLECS_ALWAYS_INLINE bool flecs_sparse_id_record_lock_read_end(
424430
ecs_component_record_t *cr);
425431

426432
/** Begin write lock on sparse component record.
427433
* a sparse id is a component marked either as sparse or non-fragmenting
434+
*
435+
* @param cr The component record.
436+
* @return true if the mut alias was violated, false otherwise.
428437
*/
429438
FLECS_API
430439
FLECS_ALWAYS_INLINE bool flecs_sparse_id_record_lock_write_begin(
431440
ecs_component_record_t *cr);
432441

433442
/** End write lock on sparse component record.
434443
* a sparse id is a component marked either as sparse or non-fragmenting
444+
*
445+
* @param cr The component record.
446+
* @return true if the mut alias was violated, false otherwise.
435447
*/
436448
FLECS_API
437449
FLECS_ALWAYS_INLINE bool flecs_sparse_id_record_lock_write_end(
438450
ecs_component_record_t *cr);
439451

440-
/** Begin read lock on table column. */
452+
/** Begin read lock on table column.
453+
*
454+
* @param table The table.
455+
* @param column_index The column index in the table.
456+
* @return true if the mut alias was violated, false otherwise.
457+
*/
441458
FLECS_API
442459
FLECS_ALWAYS_INLINE bool flecs_table_column_lock_read_begin(
443460
ecs_table_t *table,
444461
const int16_t column_index);
445462

446-
/** End read lock on table column. */
463+
/** End read lock on table column.
464+
*
465+
* @param table The table.
466+
* @param column_index The column index in the table.
467+
* @return true if the mut alias was violated, false otherwise.
468+
*/
447469
FLECS_API
448470
FLECS_ALWAYS_INLINE bool flecs_table_column_lock_read_end(
449471
ecs_table_t *table,
450472
const int16_t column_index);
451473

452-
/** Begin write lock on table column. */
474+
/** Begin write lock on table column.
475+
*
476+
* @param table The table.
477+
* @param column_index The column index in the table.
478+
* @return true if the mut alias was violated, false otherwise.
479+
*/
453480
FLECS_API
454481
FLECS_ALWAYS_INLINE bool flecs_table_column_lock_write_begin(
455482
ecs_table_t *table,
456483
const int16_t column_index);
457484

458-
/** End write lock on table column. */
485+
/** End write lock on table column.
486+
*
487+
* @param table The table.
488+
* @param column_index The column index in the table.
489+
* @return true if the mut alias was violated, false otherwise.
490+
*/
459491
FLECS_API
460492
FLECS_ALWAYS_INLINE bool flecs_table_column_lock_write_end(
461493
ecs_table_t *table,
462494
const int16_t column_index);
463495

464-
/* Begin read lock on sparse component record in multithreaded context.
496+
/** Begin read lock on sparse component record in multithreaded context.
465497
* a sparse id is a component marked either as sparse or non-fragmenting
498+
*
499+
* @param cr The component record.
500+
* @return true if the mut alias was violated, false otherwise.
466501
*/
467502
FLECS_API
468503
FLECS_ALWAYS_INLINE bool flecs_sparse_id_record_lock_read_begin_multithreaded(
469504
ecs_component_record_t *cr);
470505

471-
/* End read lock on sparse component record in multithreaded context.
506+
/** End read lock on sparse component record in multithreaded context.
472507
* a sparse id is a component marked either as sparse or non-fragmenting
508+
*
509+
* @param cr The component record.
510+
* @return true if the mut alias was violated, false otherwise.
473511
*/
474512
FLECS_API
475513
FLECS_ALWAYS_INLINE bool flecs_sparse_id_record_lock_read_end_multithreaded(
476514
ecs_component_record_t *cr);
477515

478-
/* Begin write lock on sparse component record in multithreaded context.
516+
/** Begin write lock on sparse component record in multithreaded context.
479517
* a sparse id is a component marked either as sparse or non-fragmenting
518+
*
519+
* @param cr The component record.
520+
* @return true if the mut alias was violated, false otherwise.
480521
*/
481522
FLECS_API
482523
FLECS_ALWAYS_INLINE bool flecs_sparse_id_record_lock_write_begin_multithreaded(
483524
ecs_component_record_t *cr);
484525

485-
/* End write lock on sparse component record in multithreaded context.
526+
/** End write lock on sparse component record in multithreaded context.
486527
* a sparse id is a component marked either as sparse or non-fragmenting
528+
*
529+
* @param cr The component record.
530+
* @return true if the mut alias was violated, false otherwise.
487531
*/
488532
FLECS_API
489533
FLECS_ALWAYS_INLINE bool flecs_sparse_id_record_lock_write_end_multithreaded(
490534
ecs_component_record_t *cr);
491535

492-
/* Begin read lock on table column in multithreaded context. */
536+
/** Begin read lock on table column in multithreaded context.
537+
*
538+
* @param table The table.
539+
* @param column_index The column index in the table.
540+
* @param stage_id The stage id of the calling thread.
541+
* @return true if the mut alias was violated, false otherwise.
542+
*/
493543
FLECS_API
494544
FLECS_ALWAYS_INLINE bool flecs_table_column_lock_read_begin_multithreaded(
495545
ecs_table_t *table,
496546
const int16_t column_index,
497547
const int32_t stage_id);
498548

499-
/* End read lock on table column in multithreaded context. */
549+
/** End read lock on table column in multithreaded context.
550+
*
551+
* @param table The table.
552+
* @param column_index The column index in the table.
553+
* @param stage_id The stage id of the calling thread.
554+
* @return true if the mut alias was violated, false otherwise.
555+
*/
500556
FLECS_API
501557
FLECS_ALWAYS_INLINE bool flecs_table_column_lock_read_end_multithreaded(
502558
ecs_table_t *table,
503559
const int16_t column_index,
504560
const int32_t stage_id);
505561

506-
/* Begin write lock on table column in multithreaded context. */
562+
/** Begin write lock on table column in multithreaded context.
563+
*
564+
* @param table The table.
565+
* @param column_index The column index in the table.
566+
* @param stage_id The stage id of the calling thread.
567+
* @return true if the mut alias was violated, false otherwise.
568+
*/
507569
FLECS_API
508570
FLECS_ALWAYS_INLINE bool flecs_table_column_lock_write_begin_multithreaded(
509571
ecs_table_t *table,
510572
const int16_t column_index,
511573
const int32_t stage_id);
512574

513-
/* End write lock on table column in multithreaded context. */
575+
/** End write lock on table column in multithreaded context.
576+
*
577+
* @param table The table.
578+
* @param column_index The column index in the table.
579+
* @param stage_id The stage id of the calling thread.
580+
* @return true if the mut alias was violated, false otherwise.
581+
*/
514582
FLECS_API
515583
FLECS_ALWAYS_INLINE bool flecs_table_column_lock_write_end_multithreaded(
516584
ecs_table_t *table,

0 commit comments

Comments
 (0)