48 #ifndef _ASTERISK_LOCK_H 49 #define _ASTERISK_LOCK_H 53 #include <sys/param.h> 58 #ifndef HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK 66 #define AST_PTHREADT_NULL (pthread_t) -1 67 #define AST_PTHREADT_STOP (pthread_t) -2 69 #if (defined(SOLARIS) || defined(BSD)) 70 #define AST_MUTEX_INIT_W_CONSTRUCTORS 75 #if defined(HAVE_PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP) && defined(HAVE_PTHREAD_MUTEX_RECURSIVE_NP) 76 #define PTHREAD_MUTEX_INIT_VALUE PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP 77 #define AST_MUTEX_KIND PTHREAD_MUTEX_RECURSIVE_NP 79 #define PTHREAD_MUTEX_INIT_VALUE PTHREAD_MUTEX_INITIALIZER 80 #define AST_MUTEX_KIND PTHREAD_MUTEX_RECURSIVE 83 #ifdef HAVE_PTHREAD_RWLOCK_INITIALIZER 84 #define __AST_RWLOCK_INIT_VALUE PTHREAD_RWLOCK_INITIALIZER 86 #define __AST_RWLOCK_INIT_VALUE {0} 90 #define AST_LOCK_TRACK_INIT_VALUE { { NULL }, { 0 }, 0, { NULL }, { 0 }, {{{ 0 }}}, PTHREAD_MUTEX_INIT_VALUE } 92 #define AST_LOCK_TRACK_INIT_VALUE { { NULL }, { 0 }, 0, { NULL }, { 0 }, PTHREAD_MUTEX_INIT_VALUE } 95 #define AST_MUTEX_INIT_VALUE { PTHREAD_MUTEX_INIT_VALUE, NULL, {1, 0} } 96 #define AST_MUTEX_INIT_VALUE_NOTRACKING { PTHREAD_MUTEX_INIT_VALUE, NULL, {0, 0} } 98 #define AST_RWLOCK_INIT_VALUE { __AST_RWLOCK_INIT_VALUE, NULL, {1, 0} } 99 #define AST_RWLOCK_INIT_VALUE_NOTRACKING { __AST_RWLOCK_INIT_VALUE, NULL, {0, 0} } 101 #define AST_MAX_REENTRANCY 10 137 #if !defined(DEBUG_THREADS) && !defined(DEBUG_THREADS_LOOSE_ABI) 144 #elif defined(DEBUG_THREADS) 158 #if !defined(DEBUG_THREADS) && !defined(DEBUG_THREADS_LOOSE_ABI) 165 #elif defined(DEBUG_THREADS) 184 #define ast_mutex_init(pmutex) __ast_pthread_mutex_init(1, __FILE__, __LINE__, __PRETTY_FUNCTION__, #pmutex, pmutex) 185 #define ast_mutex_init_notracking(pmutex) __ast_pthread_mutex_init(0, __FILE__, __LINE__, __PRETTY_FUNCTION__, #pmutex, pmutex) 186 #define ast_mutex_destroy(a) __ast_pthread_mutex_destroy(__FILE__, __LINE__, __PRETTY_FUNCTION__, #a, a) 187 #define ast_mutex_lock(a) __ast_pthread_mutex_lock(__FILE__, __LINE__, __PRETTY_FUNCTION__, #a, a) 188 #define ast_mutex_unlock(a) __ast_pthread_mutex_unlock(__FILE__, __LINE__, __PRETTY_FUNCTION__, #a, a) 189 #define ast_mutex_trylock(a) __ast_pthread_mutex_trylock(__FILE__, __LINE__, __PRETTY_FUNCTION__, #a, a) 199 #define ast_cond_init(cond, attr) __ast_cond_init(__FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, cond, attr) 200 #define ast_cond_destroy(cond) __ast_cond_destroy(__FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, cond) 201 #define ast_cond_signal(cond) __ast_cond_signal(__FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, cond) 202 #define ast_cond_broadcast(cond) __ast_cond_broadcast(__FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, cond) 203 #define ast_cond_wait(cond, mutex) __ast_cond_wait(__FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #mutex, cond, mutex) 204 #define ast_cond_timedwait(cond, mutex, time) __ast_cond_timedwait(__FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #mutex, cond, mutex, time) 222 #define ast_rwlock_init(rwlock) __ast_rwlock_init(1, __FILE__, __LINE__, __PRETTY_FUNCTION__, #rwlock, rwlock) 229 #define ast_rwlock_init_notracking(rwlock) __ast_rwlock_init(0, __FILE__, __LINE__, __PRETTY_FUNCTION__, #rwlock, rwlock) 231 #define ast_rwlock_destroy(rwlock) __ast_rwlock_destroy(__FILE__, __LINE__, __PRETTY_FUNCTION__, #rwlock, rwlock) 232 #define ast_rwlock_unlock(a) __ast_rwlock_unlock(__FILE__, __LINE__, __PRETTY_FUNCTION__, a, #a) 233 #define ast_rwlock_rdlock(a) __ast_rwlock_rdlock(__FILE__, __LINE__, __PRETTY_FUNCTION__, a, #a) 234 #define ast_rwlock_wrlock(a) __ast_rwlock_wrlock(__FILE__, __LINE__, __PRETTY_FUNCTION__, a, #a) 235 #define ast_rwlock_tryrdlock(a) __ast_rwlock_tryrdlock(__FILE__, __LINE__, __PRETTY_FUNCTION__, a, #a) 236 #define ast_rwlock_trywrlock(a) __ast_rwlock_trywrlock(__FILE__, __LINE__, __PRETTY_FUNCTION__, a, #a) 237 #define ast_rwlock_timedrdlock(a, b) __ast_rwlock_timedrdlock(__FILE__, __LINE__, __PRETTY_FUNCTION__, a, #a, b) 238 #define ast_rwlock_timedwrlock(a, b) __ast_rwlock_timedwrlock(__FILE__, __LINE__, __PRETTY_FUNCTION__, a, #a, b) 240 #define ROFFSET ((lt->reentrancy > 0) ? (lt->reentrancy-1) : 0) 245 #define DO_THREAD_CRASH do { *((int *)(0)) = 1; } while(0) 247 #define DO_THREAD_CRASH do { } while (0) 267 int line_num,
const char *
func,
const char *lock_name,
void *lock_addr,
struct ast_bt *bt);
322 int ast_find_lock_info(
void *lock_addr,
char *filename,
size_t filename_size,
int *
lineno,
char *
func,
size_t func_size,
char *mutex_name,
size_t mutex_name_size);
330 #define AO2_DEADLOCK_AVOIDANCE(obj) \ 332 char __filename[80], __func[80], __mutex_name[80]; \ 334 int __res = ast_find_lock_info(ao2_object_get_lockaddr(obj), __filename, sizeof(__filename), &__lineno, __func, sizeof(__func), __mutex_name, sizeof(__mutex_name)); \ 335 int __res2 = ao2_unlock(obj); \ 339 ast_log(LOG_WARNING, "Could not unlock ao2 object '%s': %s and no lock info found! I will NOT try to relock.\n", #obj, strerror(__res2)); \ 345 ast_log(LOG_WARNING, "Could not unlock ao2 object '%s': %s. {{{Originally locked at %s line %d: (%s) '%s'}}} I will NOT try to relock.\n", #obj, strerror(__res2), __filename, __lineno, __func, __mutex_name); \ 347 __ao2_lock(obj, AO2_LOCK_REQ_MUTEX, __filename, __func, __lineno, __mutex_name); \ 352 #define CHANNEL_DEADLOCK_AVOIDANCE(chan) \ 354 char __filename[80], __func[80], __mutex_name[80]; \ 356 int __res = ast_find_lock_info(ao2_object_get_lockaddr(chan), __filename, sizeof(__filename), &__lineno, __func, sizeof(__func), __mutex_name, sizeof(__mutex_name)); \ 357 int __res2 = ast_channel_unlock(chan); \ 361 ast_log(LOG_WARNING, "Could not unlock channel '%s': %s and no lock info found! I will NOT try to relock.\n", #chan, strerror(__res2)); \ 363 ast_channel_lock(chan); \ 367 ast_log(LOG_WARNING, "Could not unlock channel '%s': %s. {{{Originally locked at %s line %d: (%s) '%s'}}} I will NOT try to relock.\n", #chan, strerror(__res2), __filename, __lineno, __func, __mutex_name); \ 369 __ao2_lock(chan, AO2_LOCK_REQ_MUTEX, __filename, __func, __lineno, __mutex_name); \ 374 #define DEADLOCK_AVOIDANCE(lock) \ 376 char __filename[80], __func[80], __mutex_name[80]; \ 378 int __res = ast_find_lock_info(lock, __filename, sizeof(__filename), &__lineno, __func, sizeof(__func), __mutex_name, sizeof(__mutex_name)); \ 379 int __res2 = ast_mutex_unlock(lock); \ 383 ast_mutex_lock(lock); \ 385 ast_log(LOG_WARNING, "Could not unlock mutex '%s': %s and no lock info found! I will NOT try to relock.\n", #lock, strerror(__res2)); \ 389 __ast_pthread_mutex_lock(__filename, __lineno, __func, __mutex_name, lock); \ 391 ast_log(LOG_WARNING, "Could not unlock mutex '%s': %s. {{{Originally locked at %s line %d: (%s) '%s'}}} I will NOT try to relock.\n", #lock, strerror(__res2), __filename, __lineno, __func, __mutex_name); \ 408 #define DLA_UNLOCK(lock) \ 410 char __filename[80], __func[80], __mutex_name[80]; \ 412 int __res = ast_find_lock_info(lock, __filename, sizeof(__filename), &__lineno, __func, sizeof(__func), __mutex_name, sizeof(__mutex_name)); \ 413 int __res2 = ast_mutex_unlock(lock); 427 #define DLA_LOCK(lock) \ 430 ast_log(LOG_WARNING, "Could not unlock mutex '%s': %s and no lock info found! I will NOT try to relock.\n", #lock, strerror(__res2)); \ 432 ast_mutex_lock(lock); \ 436 ast_log(LOG_WARNING, "Could not unlock mutex '%s': %s. {{{Originally locked at %s line %d: (%s) '%s'}}} I will NOT try to relock.\n", #lock, strerror(__res2), __filename, __lineno, __func, __mutex_name); \ 438 __ast_pthread_mutex_lock(__filename, __lineno, __func, __mutex_name, lock); \ 447 fprintf(stderr,
"ast_reentrancy_lock failed: '%s' (%d)\n", strerror(res), res);
448 #if defined(DO_CRASH) || defined(THREAD_CRASH) 458 fprintf(stderr,
"ast_reentrancy_unlock failed: '%s' (%d)\n", strerror(res), res);
459 #if defined(DO_CRASH) || defined(THREAD_CRASH) 467 #define AO2_DEADLOCK_AVOIDANCE(obj) \ 472 #define CHANNEL_DEADLOCK_AVOIDANCE(chan) \ 473 ast_channel_unlock(chan); \ 475 ast_channel_lock(chan); 477 #define DEADLOCK_AVOIDANCE(lock) \ 480 if (!(__res = ast_mutex_unlock(lock))) { \ 482 ast_mutex_lock(lock); \ 484 ast_log(LOG_WARNING, "Failed to unlock mutex '%s' (%s). I will NOT try to relock. {{{ THIS IS A BUG. }}}\n", #lock, strerror(__res)); \ 488 #define DLA_UNLOCK(lock) ast_mutex_unlock(lock) 490 #define DLA_LOCK(lock) ast_mutex_lock(lock) 494 #if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) 499 #define __AST_MUTEX_DEFINE(scope, mutex, init_val, track) \ 500 scope ast_mutex_t mutex = init_val; \ 501 static void __attribute__((constructor)) init_##mutex(void) \ 504 ast_mutex_init(&mutex); \ 506 ast_mutex_init_notracking(&mutex); \ 509 static void __attribute__((destructor)) fini_##mutex(void) \ 511 ast_mutex_destroy(&mutex); \ 515 #define __AST_MUTEX_DEFINE(scope, mutex, init_val, track) scope ast_mutex_t mutex = init_val 518 #define AST_MUTEX_DEFINE_STATIC(mutex) __AST_MUTEX_DEFINE(static, mutex, AST_MUTEX_INIT_VALUE, 1) 519 #define AST_MUTEX_DEFINE_STATIC_NOTRACKING(mutex) __AST_MUTEX_DEFINE(static, mutex, AST_MUTEX_INIT_VALUE_NOTRACKING, 0) 523 #ifdef AST_MUTEX_INIT_W_CONSTRUCTORS 524 #define __AST_RWLOCK_DEFINE(scope, rwlock, init_val, track) \ 525 scope ast_rwlock_t rwlock = init_val; \ 526 static void __attribute__((constructor)) init_##rwlock(void) \ 529 ast_rwlock_init(&rwlock); \ 531 ast_rwlock_init_notracking(&rwlock); \ 533 static void __attribute__((destructor)) fini_##rwlock(void) \ 535 ast_rwlock_destroy(&rwlock); \ 538 #define __AST_RWLOCK_DEFINE(scope, rwlock, init_val, track) scope ast_rwlock_t rwlock = init_val 541 #define AST_RWLOCK_DEFINE_STATIC(rwlock) __AST_RWLOCK_DEFINE(static, rwlock, AST_RWLOCK_INIT_VALUE, 1) 542 #define AST_RWLOCK_DEFINE_STATIC_NOTRACKING(rwlock) __AST_RWLOCK_DEFINE(static, rwlock, AST_RWLOCK_INIT_VALUE_NOTRACKING, 0) 581 #define SCOPED_LOCK(varname, lock, lockfunc, unlockfunc) \ 582 RAII_VAR(typeof((lock)), varname, ({lockfunc((lock)); (lock); }), unlockfunc) 587 #define SCOPED_MUTEX(varname, lock) SCOPED_LOCK(varname, (lock), ast_mutex_lock, ast_mutex_unlock) 592 #define SCOPED_RDLOCK(varname, lock) SCOPED_LOCK(varname, (lock), ast_rwlock_rdlock, ast_rwlock_unlock) 597 #define SCOPED_WRLOCK(varname, lock) SCOPED_LOCK(varname, (lock), ast_rwlock_wrlock, ast_rwlock_unlock) 602 #define SCOPED_AO2LOCK(varname, obj) SCOPED_LOCK(varname, (obj), ao2_lock, ao2_unlock) 607 #define SCOPED_AO2RDLOCK(varname, obj) SCOPED_LOCK(varname, (obj), ao2_rdlock, ao2_unlock) 612 #define SCOPED_AO2WRLOCK(varname, obj) SCOPED_LOCK(varname, (obj), ao2_wrlock, ao2_unlock) 617 #define SCOPED_CHANNELLOCK(varname, chan) SCOPED_LOCK(varname, (chan), ast_channel_lock, ast_channel_unlock) 620 #define pthread_mutex_t use_ast_mutex_t_instead_of_pthread_mutex_t 621 #define pthread_cond_t use_ast_cond_t_instead_of_pthread_cond_t 623 #define pthread_mutex_lock use_ast_mutex_lock_instead_of_pthread_mutex_lock 624 #define pthread_mutex_unlock use_ast_mutex_unlock_instead_of_pthread_mutex_unlock 625 #define pthread_mutex_trylock use_ast_mutex_trylock_instead_of_pthread_mutex_trylock 626 #define pthread_mutex_init use_ast_mutex_init_instead_of_pthread_mutex_init 627 #define pthread_mutex_destroy use_ast_mutex_destroy_instead_of_pthread_mutex_destroy 628 #define pthread_cond_init use_ast_cond_init_instead_of_pthread_cond_init 629 #define pthread_cond_destroy use_ast_cond_destroy_instead_of_pthread_cond_destroy 630 #define pthread_cond_signal use_ast_cond_signal_instead_of_pthread_cond_signal 631 #define pthread_cond_broadcast use_ast_cond_broadcast_instead_of_pthread_cond_broadcast 632 #define pthread_cond_wait use_ast_cond_wait_instead_of_pthread_cond_wait 633 #define pthread_cond_timedwait use_ast_cond_timedwait_instead_of_pthread_cond_timedwait 635 #define AST_MUTEX_INITIALIZER __use_AST_MUTEX_DEFINE_STATIC_rather_than_AST_MUTEX_INITIALIZER__ 637 #define gethostbyname __gethostbyname__is__not__reentrant__use__ast_gethostbyname__instead__ 640 #define pthread_create __use_ast_pthread_create_instead__ 665 #if defined(HAVE_C_ATOMICS) 667 #define ast_atomic_fetch_add(ptr, val, memorder) __atomic_fetch_add((ptr), (val), (memorder)) 668 #define ast_atomic_add_fetch(ptr, val, memorder) __atomic_add_fetch((ptr), (val), (memorder)) 671 #define ast_atomic_fetch_sub(ptr, val, memorder) __atomic_fetch_sub((ptr), (val), (memorder)) 672 #define ast_atomic_sub_fetch(ptr, val, memorder) __atomic_sub_fetch((ptr), (val), (memorder)) 675 #define ast_atomic_fetch_and(ptr, val, memorder) __atomic_fetch_and((ptr), (val), (memorder)) 676 #define ast_atomic_and_fetch(ptr, val, memorder) __atomic_and_fetch((ptr), (val), (memorder)) 679 #define ast_atomic_fetch_or(ptr, val, memorder) __atomic_fetch_or((ptr), (val), (memorder)) 680 #define ast_atomic_or_fetch(ptr, val, memorder) __atomic_or_fetch((ptr), (val), (memorder)) 683 #define ast_atomic_fetch_xor(ptr, val, memorder) __atomic_fetch_xor((ptr), (val), (memorder)) 684 #define ast_atomic_xor_fetch(ptr, val, memorder) __atomic_xor_fetch((ptr), (val), (memorder)) 691 #define ast_atomic_compare_exchange_n(ptr, expected, desired, success_memorder, failure_memorder) \ 692 __atomic_compare_exchange_n((ptr), (expected), (desired), 0, success_memorder, failure_memorder) 694 #define ast_atomic_compare_exchange(ptr, expected, desired, success_memorder, failure_memorder) \ 695 __atomic_compare_exchange((ptr), (expected), (desired), 0, success_memorder, failure_memorder) 698 #elif defined(HAVE_GCC_ATOMICS) 700 #define ast_atomic_fetch_add(ptr, val, memorder) __sync_fetch_and_add((ptr), (val)) 701 #define ast_atomic_add_fetch(ptr, val, memorder) __sync_add_and_fetch((ptr), (val)) 704 #define ast_atomic_fetch_sub(ptr, val, memorder) __sync_fetch_and_sub((ptr), (val)) 705 #define ast_atomic_sub_fetch(ptr, val, memorder) __sync_sub_and_fetch((ptr), (val)) 708 #define ast_atomic_fetch_and(ptr, val, memorder) __sync_fetch_and_and((ptr), (val)) 709 #define ast_atomic_and_fetch(ptr, val, memorder) __sync_and_and_fetch((ptr), (val)) 712 #define ast_atomic_fetch_or(ptr, val, memorder) __sync_fetch_and_or((ptr), (val)) 713 #define ast_atomic_or_fetch(ptr, val, memorder) __sync_or_and_fetch((ptr), (val)) 716 #define ast_atomic_fetch_xor(ptr, val, memorder) __sync_fetch_and_xor((ptr), (val)) 717 #define ast_atomic_xor_fetch(ptr, val, memorder) __sync_xor_and_fetch((ptr), (val)) 729 #define ast_atomic_compare_exchange_n(ptr, expected, desired, success_memorder, failure_memorder) \ 730 __sync_bool_compare_and_swap((ptr), *(expected), (desired)) 732 #define ast_atomic_compare_exchange(ptr, expected, desired, success_memorder, failure_memorder) \ 733 __sync_bool_compare_and_swap((ptr), *(expected), *(desired)) 737 #error "Atomics not available." 741 #define ast_atomic_flag_set(ptr, val, memorder) ast_atomic_fetch_or((ptr), (val), (memorder)) 744 #define ast_atomic_flag_clear(ptr, val, memorder) ast_atomic_fetch_and((ptr), ~(val), (memorder)) 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)
Main Channel structure associated with a channel.
int __ast_rwlock_timedrdlock(const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name, const struct timespec *abs_timeout)
int __ast_rwlock_trywrlock(const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name)
Asterisk backtrace generation.
const char * file[AST_MAX_REENTRANCY]
int __ast_pthread_mutex_destroy(const char *filename, int lineno, const char *func, const char *mutex_name, ast_mutex_t *t)
#define ast_atomic_sub_fetch(ptr, val, memorder)
Time-related functions and macros.
int ast_find_lock_info(void *lock_addr, char *filename, size_t filename_size, int *lineno, char *func, size_t func_size, char *mutex_name, size_t mutex_name_size)
retrieve lock info for the specified mutex
void ast_mark_lock_failed(void *lock_addr)
Mark the last lock as failed (trylock)
void ast_log_show_lock(void *this_lock_addr)
log info for the current lock with ast_log().
int __ast_rwlock_rdlock(const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name)
int __ast_rwlock_timedwrlock(const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name, const struct timespec *abs_timeout)
#define ast_atomic_fetch_add(ptr, val, memorder)
Support for atomic instructions.
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_rwlock_unlock(const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name)
int lineno[AST_MAX_REENTRANCY]
struct ast_bt backtrace[AST_MAX_REENTRANCY]
int ast_atomic_fetchadd_int(volatile int *p, int v)
Atomically add v to *p and return the previous value of *p.
struct ast_lock_track * track
pthread_cond_t ast_cond_t
Compiler-specific macros and other items.
struct ast_str * ast_dump_locks(void)
Generate a lock dump equivalent to "core show locks".
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)
Lock tracking information.
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)
#define pthread_mutex_lock
volatile unsigned int setup
Inlinable API function macro.
void ast_store_lock_info(enum ast_lock_type type, const char *filename, int line_num, const char *func, const char *lock_name, void *lock_addr, struct ast_bt *bt)
Store lock info for the current thread.
int ast_atomic_dec_and_test(volatile int *p)
decrement *p by 1 and return true if the variable has reached 0.
static void ast_reentrancy_lock(struct ast_lock_track *lt)
int __ast_pthread_mutex_unlock(const char *filename, int lineno, const char *func, const char *mutex_name, ast_mutex_t *t)
int __ast_cond_broadcast(const char *filename, int lineno, const char *func, const char *cond_name, ast_cond_t *cond)
The descriptor of a dynamic string XXX storage will be optimized later if needed We use the ts field ...
void ast_remove_lock_info(void *lock_addr, struct ast_bt *bt)
remove lock info for the current thread
void ast_suspend_lock_info(void *lock_addr)
const char * func[AST_MAX_REENTRANCY]
int __ast_cond_destroy(const char *filename, int lineno, const char *func, const char *cond_name, ast_cond_t *cond)
static void ast_reentrancy_unlock(struct ast_lock_track *lt)
void ast_mark_lock_acquired(void *lock_addr)
Mark the last lock as acquired.
int __ast_rwlock_destroy(const char *filename, int lineno, const char *func, const char *rwlock_name, ast_rwlock_t *t)
int __ast_rwlock_wrlock(const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name)
#define AST_MAX_REENTRANCY
Support for logging to various files, console and syslog Configuration in file logger.conf.
Structure for rwlock and tracking information.
int __ast_pthread_mutex_lock(const char *filename, int lineno, const char *func, const char *mutex_name, ast_mutex_t *t)
int __ast_rwlock_init(int tracking, const char *filename, int lineno, const char *func, const char *rwlock_name, ast_rwlock_t *t)
pthread_t thread_id[AST_MAX_REENTRANCY]
int __ast_pthread_mutex_trylock(const char *filename, int lineno, const char *func, const char *mutex_name, ast_mutex_t *t)
pthread_mutex_t reentr_mutex
int __ast_cond_signal(const char *filename, int lineno, const char *func, const char *cond_name, ast_cond_t *cond)
#define pthread_mutex_unlock
int __ast_rwlock_tryrdlock(const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name)
void ast_restore_lock_info(void *lock_addr)
Structure for mutex and tracking information.
struct ast_lock_track * track
#define AST_INLINE_API(hdr, body)