ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
Video chat in your terminal
Loading...
Searching...
No Matches
rwlock.h File Reference

Go to the source code of this file.

Data Structures

struct  rwlock_t
 Read-write lock type (POSIX: pthread_rwlock_t with debug tracking). More...

Macros

#define LOG_RWLOCK_STATE(rwlock)
Read-Write Lock Macros
#define rwlock_rdlock(lock)
 Acquire a read lock (with debug tracking in debug builds).
#define rwlock_wrlock(lock)
 Acquire a write lock (with debug tracking in debug builds).
#define rwlock_rdunlock(lock)
 Release a read lock (with debug tracking in debug builds).
#define rwlock_wrunlock(lock)
 Release a write lock (with debug tracking in debug builds).

Functions

bool debug_sync_is_initialized (void)
int debug_sync_rwlock_rdlock (rwlock_t *rwlock, const char *file_name, int line_number, const char *function_name)
int debug_sync_rwlock_wrlock (rwlock_t *rwlock, const char *file_name, int line_number, const char *function_name)
int debug_sync_rwlock_rdunlock (rwlock_t *rwlock, const char *file_name, int line_number, const char *function_name)
int debug_sync_rwlock_wrunlock (rwlock_t *rwlock, const char *file_name, int line_number, const char *function_name)
int rwlock_init (rwlock_t *lock, const char *name)
 Initialize a read-write lock with a name.
int rwlock_destroy (rwlock_t *lock)
 Destroy a read-write lock.
void rwlock_on_rdlock (rwlock_t *rwlock)
 Hook called when a read lock is successfully acquired.
void rwlock_on_wrlock (rwlock_t *rwlock)
 Hook called when a write lock is successfully acquired.
void rwlock_on_unlock (rwlock_t *rwlock)
 Hook called when an rwlock is unlocked (read or write).
void rwlock_log_state (const rwlock_t *rwlock, const char *file, int line, const char *func)
 Format and log the current state of a read-write lock.
int rwlock_init_impl (rwlock_t *lock)
 Initialize a read-write lock (implementation function).
int rwlock_destroy_impl (rwlock_t *lock)
 Destroy a read-write lock (implementation function).
int rwlock_rdlock_impl (rwlock_t *lock)
 Acquire a read lock (implementation function).
asciichat_error_t rwlock_tryrdlock (rwlock_t *lock, bool *acquired)
int rwlock_wrlock_impl (rwlock_t *lock)
 Acquire a write lock (implementation function).
int rwlock_rdunlock_impl (rwlock_t *lock)
 Release a read lock (implementation function).
int rwlock_wrunlock_impl (rwlock_t *lock)
 Release a write lock (implementation function).