ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
lifecycle_t Struct Reference

#include <include/ascii-chat/util/lifecycle.h>

Data Fields

atomic_t state
 lifecycle_state_t enum value
 
lifecycle_sync_type_t sync_type
 Type of sync primitive (if any)
 
union { 
 
   mutex_t *   mutex 
 Pointer to mutex (if sync_type == LIFECYCLE_SYNC_MUTEX) More...
 
   rwlock_t *   rwlock 
 Pointer to rwlock (if sync_type == LIFECYCLE_SYNC_RWLOCK) More...
 
} sync 
 

Detailed Description

Lock-free module lifecycle state machine with optional sync primitive. Combines init/shutdown state with mutex or rwlock initialization.

Definition at line 58 of file lifecycle.h.

Field Documentation

◆ mutex

mutex_t* lifecycle_t::mutex

Pointer to mutex (if sync_type == LIFECYCLE_SYNC_MUTEX)

Definition at line 62 of file lifecycle.h.

Referenced by lifecycle_init(), lifecycle_reset(), lifecycle_shutdown(), and log_search_init().

◆ rwlock

rwlock_t* lifecycle_t::rwlock

Pointer to rwlock (if sync_type == LIFECYCLE_SYNC_RWLOCK)

Definition at line 63 of file lifecycle.h.

Referenced by lifecycle_init(), lifecycle_reset(), and lifecycle_shutdown().

◆ state

◆ [union]

union { ... } lifecycle_t::sync

◆ sync_type

lifecycle_sync_type_t lifecycle_t::sync_type

Type of sync primitive (if any)

Definition at line 60 of file lifecycle.h.

Referenced by lifecycle_init(), lifecycle_reset(), lifecycle_shutdown(), and log_search_init().


The documentation for this struct was generated from the following file: