ascii-chat 0.8.38
Real-time terminal-based video chat with ASCII art conversion
Loading...
Searching...
No Matches

🔒 Lock debugging and deadlock detection with call stack backtraces and lock ordering validation More...

Go to the source code of this file.

Functions

int lock_debug_init (void)
 
int lock_debug_start_thread (void)
 
void lock_debug_destroy (void)
 
void lock_debug_cleanup_thread (void)
 
void lock_debug_get_stats (uint64_t *total_acquired, uint64_t *total_released, uint32_t *currently_held)
 
bool lock_debug_is_initialized (void)
 
void lock_debug_print_state (void)
 
void lock_debug_trigger_print (void)
 
int debug_mutex_lock (mutex_t *mutex, const char *file_name, int line_number, const char *function_name)
 
int debug_mutex_trylock (mutex_t *mutex, const char *file_name, int line_number, const char *function_name)
 
int debug_mutex_unlock (mutex_t *mutex, const char *file_name, int line_number, const char *function_name)
 
int debug_rwlock_rdlock (rwlock_t *rwlock, const char *file_name, int line_number, const char *function_name)
 
int debug_rwlock_wrlock (rwlock_t *rwlock, const char *file_name, int line_number, const char *function_name)
 
int debug_rwlock_rdunlock (rwlock_t *rwlock, const char *file_name, int line_number, const char *function_name)
 
int debug_rwlock_wrunlock (rwlock_t *rwlock, const char *file_name, int line_number, const char *function_name)
 

Detailed Description

🔒 Lock debugging and deadlock detection with call stack backtraces and lock ordering validation

Date
September 2025

Definition in file lock.c.

Function Documentation

◆ debug_mutex_lock()

int debug_mutex_lock ( mutex_t *  mutex,
const char *  file_name,
int  line_number,
const char *  function_name 
)

Definition at line 1389 of file lock.c.

1389 {
1390 (void)file_name;
1391 (void)line_number;
1392 (void)function_name;
1393 return mutex_lock_impl(mutex);
1394}
int mutex_lock_impl(mutex_t *mutex)
Definition threading.c:26

References mutex_lock_impl().

◆ debug_mutex_trylock()

int debug_mutex_trylock ( mutex_t *  mutex,
const char *  file_name,
int  line_number,
const char *  function_name 
)

Definition at line 1396 of file lock.c.

1396 {
1397 (void)file_name;
1398 (void)line_number;
1399 (void)function_name;
1400 return mutex_trylock_impl(mutex);
1401}
int mutex_trylock_impl(mutex_t *mutex)
Definition threading.c:31

References mutex_trylock_impl().

◆ debug_mutex_unlock()

int debug_mutex_unlock ( mutex_t *  mutex,
const char *  file_name,
int  line_number,
const char *  function_name 
)

Definition at line 1403 of file lock.c.

1403 {
1404 (void)file_name;
1405 (void)line_number;
1406 (void)function_name;
1407 return mutex_unlock_impl(mutex);
1408}
int mutex_unlock_impl(mutex_t *mutex)
Definition threading.c:36

References mutex_unlock_impl().

◆ debug_rwlock_rdlock()

int debug_rwlock_rdlock ( rwlock_t *  rwlock,
const char *  file_name,
int  line_number,
const char *  function_name 
)

Definition at line 1410 of file lock.c.

1410 {
1411 (void)file_name;
1412 (void)line_number;
1413 (void)function_name;
1414 return rwlock_rdlock_impl(rwlock);
1415}
int rwlock_rdlock_impl(rwlock_t *rwlock)
Definition threading.c:67
rwlock_t rwlock
Read-write lock for thread-safe access (uthash requires external locking)
Definition util/time.c:32

References rwlock, and rwlock_rdlock_impl().

◆ debug_rwlock_rdunlock()

int debug_rwlock_rdunlock ( rwlock_t *  rwlock,
const char *  file_name,
int  line_number,
const char *  function_name 
)

Definition at line 1424 of file lock.c.

1424 {
1425 (void)file_name;
1426 (void)line_number;
1427 (void)function_name;
1429}
int rwlock_rdunlock_impl(rwlock_t *rwlock)
Definition threading.c:75

References rwlock, and rwlock_rdunlock_impl().

◆ debug_rwlock_wrlock()

int debug_rwlock_wrlock ( rwlock_t *  rwlock,
const char *  file_name,
int  line_number,
const char *  function_name 
)

Definition at line 1417 of file lock.c.

1417 {
1418 (void)file_name;
1419 (void)line_number;
1420 (void)function_name;
1421 return rwlock_wrlock_impl(rwlock);
1422}
int rwlock_wrlock_impl(rwlock_t *rwlock)
Definition threading.c:71

References rwlock, and rwlock_wrlock_impl().

◆ debug_rwlock_wrunlock()

int debug_rwlock_wrunlock ( rwlock_t *  rwlock,
const char *  file_name,
int  line_number,
const char *  function_name 
)

Definition at line 1431 of file lock.c.

1431 {
1432 (void)file_name;
1433 (void)line_number;
1434 (void)function_name;
1436}
int rwlock_wrunlock_impl(rwlock_t *rwlock)
Definition threading.c:79

References rwlock, and rwlock_wrunlock_impl().

◆ lock_debug_cleanup_thread()

void lock_debug_cleanup_thread ( void  )

Definition at line 1371 of file lock.c.

1371{}

Referenced by asciichat_shared_destroy(), and server_main().

◆ lock_debug_destroy()

void lock_debug_destroy ( void  )

Definition at line 1370 of file lock.c.

1370{}

Referenced by asciichat_shared_destroy(), and server_main().

◆ lock_debug_get_stats()

void lock_debug_get_stats ( uint64_t *  total_acquired,
uint64_t *  total_released,
uint32_t *  currently_held 
)

Definition at line 1372 of file lock.c.

1372 {
1373 if (total_acquired)
1374 *total_acquired = 0;
1375 if (total_released)
1376 *total_released = 0;
1377 if (currently_held)
1378 *currently_held = 0;
1379}

Referenced by stats_logger_thread().

◆ lock_debug_init()

int lock_debug_init ( void  )

Definition at line 1364 of file lock.c.

1364 {
1365 return 0;
1366}

Referenced by main().

◆ lock_debug_is_initialized()

bool lock_debug_is_initialized ( void  )

Definition at line 1380 of file lock.c.

1380 {
1381 return false;
1382}

Referenced by stats_logger_thread().

◆ lock_debug_print_state()

void lock_debug_print_state ( void  )

Definition at line 1383 of file lock.c.

1383{}

◆ lock_debug_start_thread()

int lock_debug_start_thread ( void  )

Definition at line 1367 of file lock.c.

1367 {
1368 return 0;
1369}

Referenced by main().

◆ lock_debug_trigger_print()

void lock_debug_trigger_print ( void  )

Definition at line 1384 of file lock.c.

1384{}

Referenced by session_handle_keyboard_input().