Asterisk - The Open Source Telephony Project
18.5.0
|
General Asterisk locking. More...
Go to the source code of this file.
Macros | |
#define | log_mutex_error(canlog, ...) |
Functions | |
int | __ast_cond_broadcast (const char *filename, int lineno, const char *func, const char *cond_name, ast_cond_t *cond) |
int | __ast_cond_destroy (const char *filename, int lineno, const char *func, const char *cond_name, ast_cond_t *cond) |
int | __ast_cond_init (const char *filename, int lineno, const char *func, const char *cond_name, ast_cond_t *cond, pthread_condattr_t *cond_attr) |
int | __ast_cond_signal (const char *filename, int lineno, const char *func, const char *cond_name, ast_cond_t *cond) |
int | __ast_cond_timedwait (const char *filename, int lineno, const char *func, const char *cond_name, const char *mutex_name, ast_cond_t *cond, ast_mutex_t *t, const struct timespec *abstime) |
int | __ast_cond_wait (const char *filename, int lineno, const char *func, const char *cond_name, const char *mutex_name, ast_cond_t *cond, ast_mutex_t *t) |
int | __ast_pthread_mutex_destroy (const char *filename, int lineno, const char *func, const char *mutex_name, ast_mutex_t *t) |
int | __ast_pthread_mutex_init (int tracking, const char *filename, int lineno, const char *func, const char *mutex_name, ast_mutex_t *t) |
int | __ast_pthread_mutex_lock (const char *filename, int lineno, const char *func, const char *mutex_name, ast_mutex_t *t) |
int | __ast_pthread_mutex_trylock (const char *filename, int lineno, const char *func, const char *mutex_name, ast_mutex_t *t) |
int | __ast_pthread_mutex_unlock (const char *filename, int lineno, const char *func, const char *mutex_name, ast_mutex_t *t) |
int | __ast_rwlock_destroy (const char *filename, int lineno, const char *func, const char *rwlock_name, ast_rwlock_t *t) |
int | __ast_rwlock_init (int tracking, const char *filename, int lineno, const char *func, const char *rwlock_name, ast_rwlock_t *t) |
int | __ast_rwlock_rdlock (const char *filename, int line, const char *func, ast_rwlock_t *t, const char *name) |
int | __ast_rwlock_timedrdlock (const char *filename, int line, const char *func, ast_rwlock_t *t, const char *name, const struct timespec *abs_timeout) |
int | __ast_rwlock_timedwrlock (const char *filename, int line, const char *func, ast_rwlock_t *t, const char *name, const struct timespec *abs_timeout) |
int | __ast_rwlock_tryrdlock (const char *filename, int line, const char *func, ast_rwlock_t *t, const char *name) |
int | __ast_rwlock_trywrlock (const char *filename, int line, const char *func, ast_rwlock_t *t, const char *name) |
int | __ast_rwlock_unlock (const char *filename, int line, const char *func, ast_rwlock_t *t, const char *name) |
int | __ast_rwlock_wrlock (const char *filename, int line, const char *func, ast_rwlock_t *t, const char *name) |
static void | __dump_backtrace (struct ast_bt *bt, int canlog) |
static struct ast_lock_track * | ast_get_reentrancy (struct ast_lock_track **plt, struct ast_lock_track_flags *flags, int no_setup) |
static void | delete_reentrancy_cs (struct ast_lock_track **plt) |
static void | restore_lock_tracking (struct ast_lock_track *lt, struct ast_lock_track *lt_saved) |
Variables | |
static ast_mutex_t | reentrancy_lock = { PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP , NULL, {1, 0} } |
General Asterisk locking.
Definition in file lock.c.
#define log_mutex_error | ( | canlog, | |
... | |||
) |
Definition at line 57 of file lock.c.
Referenced by __ast_cond_timedwait(), __ast_cond_wait(), __ast_pthread_mutex_destroy(), __ast_pthread_mutex_init(), __ast_pthread_mutex_lock(), __ast_pthread_mutex_trylock(), __ast_pthread_mutex_unlock(), __ast_rwlock_destroy(), __ast_rwlock_init(), __ast_rwlock_rdlock(), __ast_rwlock_timedrdlock(), __ast_rwlock_timedwrlock(), __ast_rwlock_unlock(), __ast_rwlock_wrlock(), and __dump_backtrace().
int __ast_cond_broadcast | ( | const char * | filename, |
int | lineno, | ||
const char * | func, | ||
const char * | cond_name, | ||
ast_cond_t * | cond | ||
) |
int __ast_cond_destroy | ( | const char * | filename, |
int | lineno, | ||
const char * | func, | ||
const char * | cond_name, | ||
ast_cond_t * | cond | ||
) |
int __ast_cond_init | ( | const char * | filename, |
int | lineno, | ||
const char * | func, | ||
const char * | cond_name, | ||
ast_cond_t * | cond, | ||
pthread_condattr_t * | cond_attr | ||
) |
int __ast_cond_signal | ( | const char * | filename, |
int | lineno, | ||
const char * | func, | ||
const char * | cond_name, | ||
ast_cond_t * | cond | ||
) |
int __ast_cond_timedwait | ( | const char * | filename, |
int | lineno, | ||
const char * | func, | ||
const char * | cond_name, | ||
const char * | mutex_name, | ||
ast_cond_t * | cond, | ||
ast_mutex_t * | t, | ||
const struct timespec * | abstime | ||
) |
Definition at line 604 of file lock.c.
References __dump_backtrace(), ast_get_reentrancy(), ast_reentrancy_lock(), ast_reentrancy_unlock(), ast_restore_lock_info(), ast_suspend_lock_info(), ast_lock_track::backtrace, DO_THREAD_CRASH, ast_lock_track::file, ast_mutex_info::flags, ast_lock_track::func, ast_lock_track::lineno, log_mutex_error, ast_mutex_info::mutex, NULL, pthread_cond_timedwait, pthread_mutex_t, ast_lock_track::reentrancy, restore_lock_tracking(), ROFFSET, ast_lock_track::thread_id, ast_mutex_info::track, and ast_lock_track_flags::tracking.
int __ast_cond_wait | ( | const char * | filename, |
int | lineno, | ||
const char * | func, | ||
const char * | cond_name, | ||
const char * | mutex_name, | ||
ast_cond_t * | cond, | ||
ast_mutex_t * | t | ||
) |
Definition at line 539 of file lock.c.
References __dump_backtrace(), ast_get_reentrancy(), ast_reentrancy_lock(), ast_reentrancy_unlock(), ast_restore_lock_info(), ast_suspend_lock_info(), ast_lock_track::backtrace, DO_THREAD_CRASH, ast_lock_track::file, ast_mutex_info::flags, ast_lock_track::func, ast_lock_track::lineno, log_mutex_error, ast_mutex_info::mutex, NULL, pthread_cond_wait, pthread_mutex_t, ast_lock_track::reentrancy, restore_lock_tracking(), ROFFSET, ast_lock_track::thread_id, ast_mutex_info::track, and ast_lock_track_flags::tracking.
int __ast_pthread_mutex_destroy | ( | const char * | filename, |
int | lineno, | ||
const char * | func, | ||
const char * | mutex_name, | ||
ast_mutex_t * | t | ||
) |
Definition at line 175 of file lock.c.
References __dump_backtrace(), ast_get_reentrancy(), ast_reentrancy_lock(), ast_reentrancy_unlock(), ast_lock_track::backtrace, delete_reentrancy_cs(), DO_THREAD_CRASH, ast_lock_track::file, ast_mutex_info::flags, ast_lock_track::func, ast_lock_track::lineno, log_mutex_error, ast_mutex_info::mutex, pthread_mutex_destroy, pthread_mutex_t, pthread_mutex_trylock, pthread_mutex_unlock, ast_lock_track::reentrancy, ROFFSET, ast_lock_track::thread_id, ast_mutex_info::track, and ast_lock_track_flags::tracking.
int __ast_pthread_mutex_init | ( | int | tracking, |
const char * | filename, | ||
int | lineno, | ||
const char * | func, | ||
const char * | mutex_name, | ||
ast_mutex_t * | t | ||
) |
Definition at line 144 of file lock.c.
References AST_MUTEX_KIND, DO_THREAD_CRASH, ast_mutex_info::flags, log_mutex_error, ast_mutex_info::mutex, NULL, pthread_mutex_init, pthread_mutex_t, ast_lock_track_flags::setup, ast_mutex_info::track, and ast_lock_track_flags::tracking.
int __ast_pthread_mutex_lock | ( | const char * | filename, |
int | lineno, | ||
const char * | func, | ||
const char * | mutex_name, | ||
ast_mutex_t * | t | ||
) |
Definition at line 253 of file lock.c.
References __dump_backtrace(), ast_bt_get_addresses, ast_get_reentrancy(), ast_mark(), ast_mark_lock_acquired(), AST_MAX_REENTRANCY, AST_MUTEX, ast_reentrancy_lock(), ast_reentrancy_unlock(), ast_remove_lock_info(), ast_store_lock_info(), ast_lock_track::backtrace, DO_THREAD_CRASH, ast_lock_track::file, ast_mutex_info::flags, ast_lock_track::func, ast_lock_track::lineno, log_mutex_error, ast_mutex_info::mutex, NULL, pthread_mutex_lock, pthread_mutex_trylock, ast_lock_track::reentrancy, ROFFSET, ast_lock_track::thread_id, tmp(), ast_mutex_info::track, and ast_lock_track_flags::tracking.
Referenced by __ao2_lock().
int __ast_pthread_mutex_trylock | ( | const char * | filename, |
int | lineno, | ||
const char * | func, | ||
const char * | mutex_name, | ||
ast_mutex_t * | t | ||
) |
Definition at line 366 of file lock.c.
References ast_bt_get_addresses, ast_get_reentrancy(), ast_mark_lock_acquired(), ast_mark_lock_failed(), AST_MAX_REENTRANCY, AST_MUTEX, ast_reentrancy_lock(), ast_reentrancy_unlock(), ast_store_lock_info(), ast_lock_track::backtrace, ast_lock_track::file, ast_mutex_info::flags, ast_lock_track::func, ast_lock_track::lineno, log_mutex_error, ast_mutex_info::mutex, NULL, pthread_mutex_trylock, ast_lock_track::reentrancy, ast_lock_track::thread_id, tmp(), ast_mutex_info::track, and ast_lock_track_flags::tracking.
Referenced by __ao2_trylock().
int __ast_pthread_mutex_unlock | ( | const char * | filename, |
int | lineno, | ||
const char * | func, | ||
const char * | mutex_name, | ||
ast_mutex_t * | t | ||
) |
Definition at line 421 of file lock.c.
References __dump_backtrace(), ast_get_reentrancy(), AST_MAX_REENTRANCY, ast_reentrancy_lock(), ast_reentrancy_unlock(), ast_remove_lock_info(), ast_lock_track::backtrace, DO_THREAD_CRASH, ast_lock_track::file, ast_mutex_info::flags, ast_lock_track::func, ast_lock_track::lineno, log_mutex_error, ast_mutex_info::mutex, NULL, pthread_mutex_t, pthread_mutex_unlock, ast_lock_track::reentrancy, ROFFSET, ast_lock_track::thread_id, ast_mutex_info::track, and ast_lock_track_flags::tracking.
Referenced by __ao2_unlock().
int __ast_rwlock_destroy | ( | const char * | filename, |
int | lineno, | ||
const char * | func, | ||
const char * | rwlock_name, | ||
ast_rwlock_t * | t | ||
) |
Definition at line 701 of file lock.c.
References __AST_RWLOCK_INIT_VALUE, ast_get_reentrancy(), ast_reentrancy_lock(), ast_reentrancy_unlock(), ast_lock_track::backtrace, delete_reentrancy_cs(), DO_THREAD_CRASH, ast_lock_track::file, ast_rwlock_info::flags, ast_lock_track::func, ast_lock_track::lineno, ast_rwlock_info::lock, log_mutex_error, ast_lock_track::reentrancy, ast_lock_track::thread_id, ast_rwlock_info::track, and ast_lock_track_flags::tracking.
int __ast_rwlock_init | ( | int | tracking, |
const char * | filename, | ||
int | lineno, | ||
const char * | func, | ||
const char * | rwlock_name, | ||
ast_rwlock_t * | t | ||
) |
Definition at line 669 of file lock.c.
References __AST_RWLOCK_INIT_VALUE, DO_THREAD_CRASH, ast_rwlock_info::flags, ast_rwlock_info::lock, log_mutex_error, NULL, ast_lock_track_flags::setup, ast_rwlock_info::track, and ast_lock_track_flags::tracking.
int __ast_rwlock_rdlock | ( | const char * | filename, |
int | line, | ||
const char * | func, | ||
ast_rwlock_t * | t, | ||
const char * | name | ||
) |
Definition at line 819 of file lock.c.
References __dump_backtrace(), ast_bt_get_addresses, ast_get_reentrancy(), ast_mark_lock_acquired(), AST_MAX_REENTRANCY, AST_RDLOCK, ast_reentrancy_lock(), ast_reentrancy_unlock(), ast_remove_lock_info(), ast_store_lock_info(), ast_lock_track::backtrace, DO_THREAD_CRASH, ast_lock_track::file, ast_rwlock_info::flags, ast_lock_track::func, ast_lock_track::lineno, ast_rwlock_info::lock, log_mutex_error, NULL, ast_lock_track::reentrancy, ast_lock_track::thread_id, tmp(), ast_rwlock_info::track, and ast_lock_track_flags::tracking.
Referenced by __ao2_global_obj_ref(), __ao2_lock(), and __ast_heap_rdlock().
int __ast_rwlock_timedrdlock | ( | const char * | filename, |
int | line, | ||
const char * | func, | ||
ast_rwlock_t * | t, | ||
const char * | name, | ||
const struct timespec * | abs_timeout | ||
) |
Definition at line 1014 of file lock.c.
References ast_bt_get_addresses, ast_get_reentrancy(), ast_mark_lock_acquired(), AST_MAX_REENTRANCY, ast_reentrancy_lock(), ast_reentrancy_unlock(), ast_remove_lock_info(), ast_store_lock_info(), ast_tvnow(), AST_WRLOCK, ast_lock_track::backtrace, DO_THREAD_CRASH, ast_lock_track::file, ast_rwlock_info::flags, ast_lock_track::func, ast_lock_track::lineno, ast_rwlock_info::lock, log_mutex_error, NULL, ast_lock_track::reentrancy, ast_lock_track::thread_id, tmp(), ast_rwlock_info::track, and ast_lock_track_flags::tracking.
int __ast_rwlock_timedwrlock | ( | const char * | filename, |
int | line, | ||
const char * | func, | ||
ast_rwlock_t * | t, | ||
const char * | name, | ||
const struct timespec * | abs_timeout | ||
) |
Definition at line 1096 of file lock.c.
References ast_bt_get_addresses, ast_get_reentrancy(), ast_mark_lock_acquired(), AST_MAX_REENTRANCY, ast_reentrancy_lock(), ast_reentrancy_unlock(), ast_remove_lock_info(), ast_store_lock_info(), ast_tvnow(), AST_WRLOCK, ast_lock_track::backtrace, DO_THREAD_CRASH, ast_lock_track::file, ast_rwlock_info::flags, ast_lock_track::func, ast_lock_track::lineno, ast_rwlock_info::lock, log_mutex_error, NULL, ast_lock_track::reentrancy, ast_lock_track::thread_id, tmp(), ast_rwlock_info::track, and ast_lock_track_flags::tracking.
int __ast_rwlock_tryrdlock | ( | const char * | filename, |
int | line, | ||
const char * | func, | ||
ast_rwlock_t * | t, | ||
const char * | name | ||
) |
Definition at line 1178 of file lock.c.
References ast_bt_get_addresses, ast_get_reentrancy(), ast_mark_lock_acquired(), ast_mark_lock_failed(), AST_MAX_REENTRANCY, AST_RDLOCK, ast_reentrancy_lock(), ast_reentrancy_unlock(), ast_store_lock_info(), ast_lock_track::backtrace, ast_lock_track::file, ast_rwlock_info::flags, ast_lock_track::func, ast_lock_track::lineno, ast_rwlock_info::lock, NULL, ast_lock_track::reentrancy, ast_lock_track::thread_id, tmp(), and ast_rwlock_info::track.
Referenced by __ao2_trylock().
int __ast_rwlock_trywrlock | ( | const char * | filename, |
int | line, | ||
const char * | func, | ||
ast_rwlock_t * | t, | ||
const char * | name | ||
) |
Definition at line 1228 of file lock.c.
References ast_bt_get_addresses, ast_get_reentrancy(), ast_mark_lock_acquired(), ast_mark_lock_failed(), AST_MAX_REENTRANCY, ast_reentrancy_lock(), ast_reentrancy_unlock(), ast_store_lock_info(), AST_WRLOCK, ast_lock_track::backtrace, ast_lock_track::file, ast_rwlock_info::flags, ast_lock_track::func, ast_lock_track::lineno, ast_rwlock_info::lock, NULL, ast_lock_track::reentrancy, ast_lock_track::thread_id, tmp(), and ast_rwlock_info::track.
Referenced by __ao2_trylock().
int __ast_rwlock_unlock | ( | const char * | filename, |
int | line, | ||
const char * | func, | ||
ast_rwlock_t * | t, | ||
const char * | name | ||
) |
Definition at line 748 of file lock.c.
References __AST_RWLOCK_INIT_VALUE, ast_get_reentrancy(), AST_PTHREADT_NULL, ast_reentrancy_lock(), ast_reentrancy_unlock(), ast_remove_lock_info(), ast_lock_track::backtrace, DO_THREAD_CRASH, ast_lock_track::file, ast_rwlock_info::flags, ast_lock_track::func, ast_lock_track::lineno, ast_rwlock_info::lock, log_mutex_error, NULL, ast_lock_track::reentrancy, ast_lock_track::thread_id, ast_rwlock_info::track, and ast_lock_track_flags::tracking.
Referenced by __ao2_global_obj_ref(), __ao2_global_obj_replace(), __ao2_unlock(), and __ast_heap_unlock().
int __ast_rwlock_wrlock | ( | const char * | filename, |
int | line, | ||
const char * | func, | ||
ast_rwlock_t * | t, | ||
const char * | name | ||
) |
Definition at line 917 of file lock.c.
References __dump_backtrace(), ast_bt_get_addresses, ast_get_reentrancy(), ast_mark_lock_acquired(), AST_MAX_REENTRANCY, ast_reentrancy_lock(), ast_reentrancy_unlock(), ast_remove_lock_info(), ast_store_lock_info(), AST_WRLOCK, ast_lock_track::backtrace, DO_THREAD_CRASH, ast_lock_track::file, ast_rwlock_info::flags, ast_lock_track::func, ast_lock_track::lineno, ast_rwlock_info::lock, log_mutex_error, NULL, ast_lock_track::reentrancy, ast_lock_track::thread_id, tmp(), ast_rwlock_info::track, and ast_lock_track_flags::tracking.
Referenced by __ao2_global_obj_replace(), __ao2_lock(), and __ast_heap_wrlock().
|
static |
Definition at line 68 of file lock.c.
References ast_bt::addresses, ast_std_free(), log_mutex_error, and ast_bt::num_frames.
Referenced by __ast_cond_timedwait(), __ast_cond_wait(), __ast_pthread_mutex_destroy(), __ast_pthread_mutex_lock(), __ast_pthread_mutex_unlock(), __ast_rwlock_rdlock(), and __ast_rwlock_wrlock().
|
static |
Definition at line 86 of file lock.c.
References AST_MUTEX_KIND, ast_std_calloc(), ast_mutex_info::mutex, NULL, pthread_mutex_init, pthread_mutex_lock, pthread_mutex_unlock, ast_lock_track::reentr_mutex, reentrancy_lock, ast_lock_track_flags::setup, and ast_lock_track_flags::tracking.
Referenced by __ast_cond_timedwait(), __ast_cond_wait(), __ast_pthread_mutex_destroy(), __ast_pthread_mutex_lock(), __ast_pthread_mutex_trylock(), __ast_pthread_mutex_unlock(), __ast_rwlock_destroy(), __ast_rwlock_rdlock(), __ast_rwlock_timedrdlock(), __ast_rwlock_timedwrlock(), __ast_rwlock_tryrdlock(), __ast_rwlock_trywrlock(), __ast_rwlock_unlock(), and __ast_rwlock_wrlock().
|
inlinestatic |
Definition at line 129 of file lock.c.
References ast_std_free(), NULL, pthread_mutex_destroy, and ast_lock_track::reentr_mutex.
Referenced by __ast_pthread_mutex_destroy(), and __ast_rwlock_destroy().
|
static |
Definition at line 517 of file lock.c.
References ast_reentrancy_lock(), ast_reentrancy_unlock(), ast_lock_track::backtrace, ast_lock_track::file, ast_lock_track::func, ast_lock_track::lineno, ast_lock_track::reentrancy, and ast_lock_track::thread_id.
Referenced by __ast_cond_timedwait(), and __ast_cond_wait().
|
static |
Definition at line 84 of file lock.c.
Referenced by ast_get_reentrancy().