Asterisk - The Open Source Telephony Project
18.5.0
|
Asterisk locking-related definitions: More...
#include <pthread.h>
#include <time.h>
#include <sys/param.h>
#include <execinfo.h>
#include "asterisk/backtrace.h"
#include "asterisk/logger.h"
#include "asterisk/compiler.h"
#include <errno.h>
#include "asterisk/inline_api.h"
Go to the source code of this file.
Data Structures | |
struct | ast_lock_track |
Lock tracking information. More... | |
struct | ast_lock_track_flags |
struct | ast_mutex_info |
Structure for mutex and tracking information. More... | |
struct | ast_rwlock_info |
Structure for rwlock and tracking information. More... | |
Macros | |
#define | __AST_MUTEX_DEFINE(scope, mutex, init_val, track) scope ast_mutex_t mutex = init_val |
#define | __AST_RWLOCK_DEFINE(scope, rwlock, init_val, track) scope ast_rwlock_t rwlock = init_val |
#define | __AST_RWLOCK_INIT_VALUE PTHREAD_RWLOCK_INITIALIZER |
#define | AO2_DEADLOCK_AVOIDANCE(obj) |
Unlock a lock briefly. More... | |
#define | ast_cond_broadcast(cond) __ast_cond_broadcast(__FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, cond) |
#define | ast_cond_destroy(cond) __ast_cond_destroy(__FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, cond) |
#define | ast_cond_init(cond, attr) __ast_cond_init(__FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, cond, attr) |
#define | ast_cond_signal(cond) __ast_cond_signal(__FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, cond) |
#define | ast_cond_timedwait(cond, mutex, time) __ast_cond_timedwait(__FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #mutex, cond, mutex, time) |
#define | ast_cond_wait(cond, mutex) __ast_cond_wait(__FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #mutex, cond, mutex) |
#define | AST_LOCK_TRACK_INIT_VALUE { { NULL }, { 0 }, 0, { NULL }, { 0 }, {{{ 0 }}}, PTHREAD_MUTEX_INIT_VALUE } |
#define | AST_MAX_REENTRANCY 10 |
#define | AST_MUTEX_DEFINE_STATIC(mutex) __AST_MUTEX_DEFINE(static, mutex, AST_MUTEX_INIT_VALUE, 1) |
#define | AST_MUTEX_DEFINE_STATIC_NOTRACKING(mutex) __AST_MUTEX_DEFINE(static, mutex, AST_MUTEX_INIT_VALUE_NOTRACKING, 0) |
#define | ast_mutex_destroy(a) __ast_pthread_mutex_destroy(__FILE__, __LINE__, __PRETTY_FUNCTION__, #a, a) |
#define | ast_mutex_init(pmutex) __ast_pthread_mutex_init(1, __FILE__, __LINE__, __PRETTY_FUNCTION__, #pmutex, pmutex) |
#define | ast_mutex_init_notracking(pmutex) __ast_pthread_mutex_init(0, __FILE__, __LINE__, __PRETTY_FUNCTION__, #pmutex, pmutex) |
#define | AST_MUTEX_INIT_VALUE { PTHREAD_MUTEX_INIT_VALUE, NULL, {1, 0} } |
#define | AST_MUTEX_INIT_VALUE_NOTRACKING { PTHREAD_MUTEX_INIT_VALUE, NULL, {0, 0} } |
#define | AST_MUTEX_INITIALIZER __use_AST_MUTEX_DEFINE_STATIC_rather_than_AST_MUTEX_INITIALIZER__ |
#define | AST_MUTEX_KIND PTHREAD_MUTEX_RECURSIVE_NP |
#define | ast_mutex_lock(a) __ast_pthread_mutex_lock(__FILE__, __LINE__, __PRETTY_FUNCTION__, #a, a) |
#define | ast_mutex_trylock(a) __ast_pthread_mutex_trylock(__FILE__, __LINE__, __PRETTY_FUNCTION__, #a, a) |
#define | ast_mutex_unlock(a) __ast_pthread_mutex_unlock(__FILE__, __LINE__, __PRETTY_FUNCTION__, #a, a) |
#define | AST_PTHREADT_NULL (pthread_t) -1 |
#define | AST_PTHREADT_STOP (pthread_t) -2 |
#define | AST_RWLOCK_DEFINE_STATIC(rwlock) __AST_RWLOCK_DEFINE(static, rwlock, AST_RWLOCK_INIT_VALUE, 1) |
#define | AST_RWLOCK_DEFINE_STATIC_NOTRACKING(rwlock) __AST_RWLOCK_DEFINE(static, rwlock, AST_RWLOCK_INIT_VALUE_NOTRACKING, 0) |
#define | ast_rwlock_destroy(rwlock) __ast_rwlock_destroy(__FILE__, __LINE__, __PRETTY_FUNCTION__, #rwlock, rwlock) |
#define | ast_rwlock_init(rwlock) __ast_rwlock_init(1, __FILE__, __LINE__, __PRETTY_FUNCTION__, #rwlock, rwlock) |
wrapper for rwlock with tracking enabled More... | |
#define | ast_rwlock_init_notracking(rwlock) __ast_rwlock_init(0, __FILE__, __LINE__, __PRETTY_FUNCTION__, #rwlock, rwlock) |
wrapper for ast_rwlock_init with tracking disabled More... | |
#define | AST_RWLOCK_INIT_VALUE { __AST_RWLOCK_INIT_VALUE, NULL, {1, 0} } |
#define | AST_RWLOCK_INIT_VALUE_NOTRACKING { __AST_RWLOCK_INIT_VALUE, NULL, {0, 0} } |
#define | ast_rwlock_rdlock(a) __ast_rwlock_rdlock(__FILE__, __LINE__, __PRETTY_FUNCTION__, a, #a) |
#define | ast_rwlock_timedrdlock(a, b) __ast_rwlock_timedrdlock(__FILE__, __LINE__, __PRETTY_FUNCTION__, a, #a, b) |
#define | ast_rwlock_timedwrlock(a, b) __ast_rwlock_timedwrlock(__FILE__, __LINE__, __PRETTY_FUNCTION__, a, #a, b) |
#define | ast_rwlock_tryrdlock(a) __ast_rwlock_tryrdlock(__FILE__, __LINE__, __PRETTY_FUNCTION__, a, #a) |
#define | ast_rwlock_trywrlock(a) __ast_rwlock_trywrlock(__FILE__, __LINE__, __PRETTY_FUNCTION__, a, #a) |
#define | ast_rwlock_unlock(a) __ast_rwlock_unlock(__FILE__, __LINE__, __PRETTY_FUNCTION__, a, #a) |
#define | ast_rwlock_wrlock(a) __ast_rwlock_wrlock(__FILE__, __LINE__, __PRETTY_FUNCTION__, a, #a) |
#define | CHANNEL_DEADLOCK_AVOIDANCE(chan) |
#define | DEADLOCK_AVOIDANCE(lock) |
#define | DLA_LOCK(lock) |
Deadlock avoidance lock. More... | |
#define | DLA_UNLOCK(lock) |
Deadlock avoidance unlock. More... | |
#define | DO_THREAD_CRASH do { } while (0) |
#define | gethostbyname __gethostbyname__is__not__reentrant__use__ast_gethostbyname__instead__ |
#define | pthread_cond_broadcast use_ast_cond_broadcast_instead_of_pthread_cond_broadcast |
#define | pthread_cond_destroy use_ast_cond_destroy_instead_of_pthread_cond_destroy |
#define | pthread_cond_init use_ast_cond_init_instead_of_pthread_cond_init |
#define | pthread_cond_signal use_ast_cond_signal_instead_of_pthread_cond_signal |
#define | pthread_cond_t use_ast_cond_t_instead_of_pthread_cond_t |
#define | pthread_cond_timedwait use_ast_cond_timedwait_instead_of_pthread_cond_timedwait |
#define | pthread_cond_wait use_ast_cond_wait_instead_of_pthread_cond_wait |
#define | pthread_create __use_ast_pthread_create_instead__ |
#define | pthread_mutex_destroy use_ast_mutex_destroy_instead_of_pthread_mutex_destroy |
#define | pthread_mutex_init use_ast_mutex_init_instead_of_pthread_mutex_init |
#define | PTHREAD_MUTEX_INIT_VALUE PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP |
#define | pthread_mutex_lock use_ast_mutex_lock_instead_of_pthread_mutex_lock |
#define | pthread_mutex_t use_ast_mutex_t_instead_of_pthread_mutex_t |
#define | pthread_mutex_trylock use_ast_mutex_trylock_instead_of_pthread_mutex_trylock |
#define | pthread_mutex_unlock use_ast_mutex_unlock_instead_of_pthread_mutex_unlock |
#define | ROFFSET ((lt->reentrancy > 0) ? (lt->reentrancy-1) : 0) |
#define | SCOPED_AO2LOCK(varname, obj) SCOPED_LOCK(varname, (obj), ao2_lock, ao2_unlock) |
scoped lock specialization for ao2 mutexes. More... | |
#define | SCOPED_AO2RDLOCK(varname, obj) SCOPED_LOCK(varname, (obj), ao2_rdlock, ao2_unlock) |
scoped lock specialization for ao2 read locks. More... | |
#define | SCOPED_AO2WRLOCK(varname, obj) SCOPED_LOCK(varname, (obj), ao2_wrlock, ao2_unlock) |
scoped lock specialization for ao2 write locks. More... | |
#define | SCOPED_CHANNELLOCK(varname, chan) SCOPED_LOCK(varname, (chan), ast_channel_lock, ast_channel_unlock) |
scoped lock specialization for channels. More... | |
#define | SCOPED_LOCK(varname, lock, lockfunc, unlockfunc) RAII_VAR(typeof((lock)), varname, ({lockfunc((lock)); (lock); }), unlockfunc) |
Scoped Locks. More... | |
#define | SCOPED_MUTEX(varname, lock) SCOPED_LOCK(varname, (lock), ast_mutex_lock, ast_mutex_unlock) |
scoped lock specialization for mutexes More... | |
#define | SCOPED_RDLOCK(varname, lock) SCOPED_LOCK(varname, (lock), ast_rwlock_rdlock, ast_rwlock_unlock) |
scoped lock specialization for read locks More... | |
#define | SCOPED_WRLOCK(varname, lock) SCOPED_LOCK(varname, (lock), ast_rwlock_wrlock, ast_rwlock_unlock) |
scoped lock specialization for write locks More... | |
Typedefs | |
typedef pthread_cond_t | ast_cond_t |
typedef struct ast_mutex_info | ast_mutex_t |
typedef struct ast_rwlock_info | ast_rwlock_t |
Enumerations | |
enum | ast_lock_type { AST_MUTEX, AST_RDLOCK, AST_WRLOCK } |
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 lineno, const char *func, ast_rwlock_t *t, const char *name) |
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_timedwrlock (const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name, const struct timespec *abs_timeout) |
int | __ast_rwlock_tryrdlock (const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name) |
int | __ast_rwlock_trywrlock (const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name) |
int | __ast_rwlock_unlock (const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name) |
int | __ast_rwlock_wrlock (const char *filename, int lineno, const char *func, ast_rwlock_t *t, const char *name) |
struct ast_str * | ast_dump_locks (void) |
Generate a lock dump equivalent to "core show locks". More... | |
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 More... | |
void | ast_log_show_lock (void *this_lock_addr) |
log info for the current lock with ast_log(). More... | |
void | ast_mark_lock_acquired (void *lock_addr) |
Mark the last lock as acquired. More... | |
void | ast_mark_lock_failed (void *lock_addr) |
Mark the last lock as failed (trylock) More... | |
static void | ast_reentrancy_lock (struct ast_lock_track *lt) |
static void | ast_reentrancy_unlock (struct ast_lock_track *lt) |
void | ast_remove_lock_info (void *lock_addr, struct ast_bt *bt) |
remove lock info for the current thread More... | |
void | ast_restore_lock_info (void *lock_addr) |
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. More... | |
void | ast_suspend_lock_info (void *lock_addr) |
#define | ast_atomic_fetch_add(ptr, val, memorder) __atomic_fetch_add((ptr), (val), (memorder)) |
Support for atomic instructions. More... | |
#define | ast_atomic_add_fetch(ptr, val, memorder) __atomic_add_fetch((ptr), (val), (memorder)) |
#define | ast_atomic_fetch_sub(ptr, val, memorder) __atomic_fetch_sub((ptr), (val), (memorder)) |
#define | ast_atomic_sub_fetch(ptr, val, memorder) __atomic_sub_fetch((ptr), (val), (memorder)) |
#define | ast_atomic_fetch_and(ptr, val, memorder) __atomic_fetch_and((ptr), (val), (memorder)) |
#define | ast_atomic_and_fetch(ptr, val, memorder) __atomic_and_fetch((ptr), (val), (memorder)) |
#define | ast_atomic_fetch_or(ptr, val, memorder) __atomic_fetch_or((ptr), (val), (memorder)) |
#define | ast_atomic_or_fetch(ptr, val, memorder) __atomic_or_fetch((ptr), (val), (memorder)) |
#define | ast_atomic_fetch_xor(ptr, val, memorder) __atomic_fetch_xor((ptr), (val), (memorder)) |
#define | ast_atomic_xor_fetch(ptr, val, memorder) __atomic_xor_fetch((ptr), (val), (memorder)) |
#define | ast_atomic_flag_set(ptr, val, memorder) ast_atomic_fetch_or((ptr), (val), (memorder)) |
#define | ast_atomic_flag_clear(ptr, val, memorder) ast_atomic_fetch_and((ptr), ~(val), (memorder)) |
int | ast_atomic_fetchadd_int (volatile int *p, int v) |
Atomically add v to *p and return the previous value of *p. More... | |
int | ast_atomic_dec_and_test (volatile int *p) |
decrement *p by 1 and return true if the variable has reached 0. More... | |
Asterisk locking-related definitions:
Magic number.
This is used to verify that a pointer is a valid astobj2 or ao2_weak reference.
Definition in file lock.h.
#define __AST_MUTEX_DEFINE | ( | scope, | |
mutex, | |||
init_val, | |||
track | |||
) | scope ast_mutex_t mutex = init_val |
#define __AST_RWLOCK_DEFINE | ( | scope, | |
rwlock, | |||
init_val, | |||
track | |||
) | scope ast_rwlock_t rwlock = init_val |
#define __AST_RWLOCK_INIT_VALUE PTHREAD_RWLOCK_INITIALIZER |
Definition at line 84 of file lock.h.
Referenced by __ast_rwlock_destroy(), __ast_rwlock_init(), and __ast_rwlock_unlock().
#define AO2_DEADLOCK_AVOIDANCE | ( | obj | ) |
Support for atomic instructions.
These macros implement a uniform interface to use built-in atomic functionality. If available __atomic built-ins are prefered. Legacy __sync built-ins are used as a fallback for older compilers.
Detailed documentation can be found in the GCC manual, all API's are modeled after the __atomic interfaces but using the namespace ast_atomic.
The memorder argument is always ignored by legacy __sync functions. Invalid memorder arguments do not produce errors unless __atomic functions are supported as the argument is erased by the preprocessor.
Atomic +=
Definition at line 667 of file lock.h.
Referenced by __ao2_ref().
#define ast_atomic_flag_clear | ( | ptr, | |
val, | |||
memorder | |||
) | ast_atomic_fetch_and((ptr), ~(val), (memorder)) |
#define ast_atomic_flag_set | ( | ptr, | |
val, | |||
memorder | |||
) | ast_atomic_fetch_or((ptr), (val), (memorder)) |
Definition at line 672 of file lock.h.
Referenced by ast_atomic_fetchadd_int().
#define ast_cond_broadcast | ( | cond | ) | __ast_cond_broadcast(__FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, cond) |
Definition at line 202 of file lock.h.
Referenced by add_notify(), ast_smdi_md_message_push(), ast_smdi_mwi_message_push(), inotify_daemon(), and xmpp_pak_message().
#define ast_cond_destroy | ( | cond | ) | __ast_cond_destroy(__FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, cond) |
Definition at line 200 of file lock.h.
Referenced by __unload_module(), ast_audiohook_destroy(), ast_bridge_impart(), ast_sip_push_task_wait(), AST_TEST_DEFINE(), async_data_destructor(), async_datastore_data_destroy(), async_minimal_data_destructor(), attended_transfer_properties_destructor(), bridge_channel_destroy(), bridge_manager_destroy(), cel_verify_and_cleanup_cb(), command_dtor(), complex_task_data_free(), consumer_dtor(), control_dtor(), data_cleanup(), dispatch_message(), dns_synchronous_resolve_destroy(), finalize_batch_mode(), find_idle_thread(), hangup_data_destroy(), iax2_process_thread_cleanup(), init_logger(), mixmonitor_free(), odbc_class_destructor(), off_nominal_async_data_destructor(), ooh323_request(), pbx_outgoing_destroy(), playback_task_data_destroy(), query_set_data_destructor(), recurring_data_destructor(), resolver_data_cleanup(), sched_free(), sched_thread_destroy(), serializer_shutdown_group_dtor(), setup_mixmonitor_ds(), shutdown_data_dtor(), simple_task_data_free(), sip_session_suspender_dtor(), sla_destroy(), sla_handle_dial_state_event(), sla_station_exec(), smdi_interface_destroy(), softmix_bridge_data_destroy(), start_network_thread(), stasis_message_sink_dtor(), subscription_dtor(), task_data_dtor(), test_shutdown(), unload_module(), and worker_thread_destroy().
#define ast_cond_init | ( | cond, | |
attr | |||
) | __ast_cond_init(__FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, cond, attr) |
Definition at line 199 of file lock.h.
Referenced by add_notify(), alloc_smdi_interface(), ast_audiohook_init(), ast_autoservice_init(), ast_bridge_impart(), ast_device_state_engine_init(), ast_dns_resolve(), ast_query_set_resolve(), ast_sched_start_thread(), ast_serializer_shutdown_group_alloc(), ast_sip_push_task_wait(), ast_sip_session_suspend(), AST_TEST_DEFINE(), ast_tps_init(), astdb_init(), async_data_alloc(), async_datastore_data_alloc(), async_minimal_data_alloc(), attended_transfer_properties_alloc(), bridge_channel_internal_alloc(), bridge_manager_create(), build_calendar(), cdr_enable_batch_mode(), command_create(), complex_task_data_alloc(), consumer_create(), control_create(), db_start_batch(), dispatch_message(), find_idle_thread(), get_lock(), hangup_data_init(), init_logger(), init_timing_thread(), internal_stasis_subscribe(), load_module(), load_odbc_config(), off_nominal_async_data_alloc(), ooh323_request(), pbx_outgoing_attempt(), playback_task_data_init(), query_set_data_alloc(), recurring_data_alloc(), resolver_data_init(), rtp_allocate_transport(), sched_alloc(), scheduler(), setup_mixmonitor_ds(), shutdown_data_create(), simple_task_data_alloc(), sla_handle_dial_state_event(), sla_load_config(), sla_station_exec(), softmix_bridge_create(), start_network_thread(), stasis_message_sink_create(), task_data_create(), test_alloc(), test_cel_init_cb(), and worker_thread_alloc().
#define ast_cond_signal | ( | cond | ) | __ast_cond_signal(__FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, cond) |
Definition at line 201 of file lock.h.
Referenced by add_notify(), amihook_helper(), analog_ss_thread(), ast_audiohook_update_status(), ast_audiohook_write_frame(), ast_autoservice_start(), ast_devstate_changed_literal(), ast_log_full(), ast_odbc_release_obj(), ast_rtp_on_turn_rtcp_state(), ast_rtp_on_turn_rtp_state(), ast_sched_add_variable(), ast_sched_del(), ast_sched_runq(), ast_sip_session_unsuspend(), async_callback(), async_play_sound_ready(), autoservice_shutdown(), bridge_channel_impart_ds_head_signal(), bridge_channel_internal_unsuspend_nolock(), bridge_manager_destroy(), bridge_manager_service_req(), calendar_destructor(), chan_test_devicestate_cb(), close_logger(), command_complete(), complex_task(), conf_free(), conf_run(), consumer_exec(), db_sync(), defer_full_frame(), device_state_cb(), device_state_engine_cleanup(), dial_trunk(), dispatch_exec_sync(), dns_synchronous_resolve_callback(), exec_command_on_condition(), get_lock(), hangup_playback(), load_task(), lock_free(), message_sink_cb(), minimal_callback(), mixmonitor_ds_destroy(), mock_cdr_backend_cb(), my_decrease_ss_count(), off_nominal_async_callback(), onCallCleared(), onNewCallCreated(), pbx_outgoing_exec(), playback_task(), poke_worker(), pthread_timer_open(), query_set_callback(), recurring_cancel(), resolution_thread(), run_station(), sched_thread_destroy(), schedule_cache_expiration(), schedule_calendar_event(), serializer_shutdown_group_dec(), shutdown_poke(), shutdown_task_exec(), signal_condition(), simple_task(), sip_session_suspend_task(), sla_destroy(), sla_queue_event_full(), softmix_bridge_destroy(), softmix_poke_thread(), sorcery_observer_created(), sorcery_observer_deleted(), sorcery_observer_loaded(), sorcery_observer_updated(), start_batch_mode(), stimulate_attended_transfer(), stop_mixmonitor_full(), stop_poll_thread(), subscription_invoke(), sync_task(), task(), task_1(), test_cancel(), test_emptied(), test_msg_handle_msg_cb(), test_state_changed(), test_sub(), test_task_pushed(), tps_ping_handler(), unload_module(), unlock_read(), user_event_hook_cb(), and worker_set_state().
#define ast_cond_timedwait | ( | cond, | |
mutex, | |||
time | |||
) | __ast_cond_timedwait(__FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #mutex, cond, mutex, time) |
Definition at line 204 of file lock.h.
Referenced by acf_jabberreceive_read(), ast_audiohook_trigger_wait(), ast_localtime_wakeup_monitor(), ast_rtp_ice_turn_request(), ast_serializer_shutdown_group_join(), AST_TEST_DEFINE(), caldav_load_calendar(), cli_tps_ping(), consumer_should_stay(), consumer_wait_for(), consumer_wait_for_completion(), do_cdr(), do_refresh(), do_timing(), ewscal_load_calendar(), exchangecal_load_calendar(), get_lock(), handler_wait_for_message(), has_complex_started(), iax2_process_thread(), ical_load_calendar(), ice_reset_session(), mb_poll_thread(), mid_test_sync(), mwi_monitor_handler(), query_set_test(), resolution_thread(), rtp_deallocate_transport(), sched_run(), shutdown_waitfor_completion(), shutdown_waitfor_start(), sla_thread(), smdi_message_wait(), stasis_message_sink_should_stay(), stasis_message_sink_wait_for(), stasis_message_sink_wait_for_count(), task_wait(), user_event_wait_for_events(), verify_mock_cdr_record(), wait_for_channel_callback(), wait_for_completion(), wait_for_complex_completion(), wait_for_complex_start(), wait_for_device_state_updates(), wait_for_empty_notice(), wait_for_hook(), wait_for_resolution(), wait_for_stimulus(), wait_for_task_pushed(), wait_until_thread_state(), wait_until_thread_state_task_pushed(), and worker_idle().
#define ast_cond_wait | ( | cond, | |
mutex | |||
) | __ast_cond_wait(__FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #mutex, cond, mutex) |
Definition at line 203 of file lock.h.
Referenced by _ast_odbc_request_obj2(), add_notify(), announce_thread(), ast_dns_resolve(), ast_query_set_resolve(), ast_sched_del(), ast_serializer_shutdown_group_join(), ast_sip_push_task_wait(), ast_sip_session_suspend(), AST_TEST_DEFINE(), autoservice_run(), bridge_channel_impart_wait(), bridge_channel_wait(), bridge_manager_thread(), command_join(), complex_task(), control_wait(), dahdi_restart(), db_sync_thread(), destroy_conference_bridge(), dispatch_message(), do_devstate_changes(), do_timing(), find_idle_thread(), iax2_process_thread(), logger_thread(), mixmonitor_thread(), nominal_async_run(), off_nominal_async_run(), ooh323_request(), pbx_outgoing_attempt(), play_sound_helper(), resolution_thread(), sched_run(), shutdown_task_exec(), sip_session_suspend_task(), sla_handle_dial_state_event(), sla_station_exec(), sla_thread(), softmix_mixing_thread(), start_network_thread(), stasis_message_sink_dtor(), stasis_subscription_join(), unload_module(), wait_for_initiator(), wait_for_stimulus(), and worker_idle().
#define AST_LOCK_TRACK_INIT_VALUE { { NULL }, { 0 }, 0, { NULL }, { 0 }, {{{ 0 }}}, PTHREAD_MUTEX_INIT_VALUE } |
#define AST_MAX_REENTRANCY 10 |
Definition at line 101 of file lock.h.
Referenced by __ast_pthread_mutex_lock(), __ast_pthread_mutex_trylock(), __ast_pthread_mutex_unlock(), __ast_rwlock_rdlock(), __ast_rwlock_timedrdlock(), __ast_rwlock_timedwrlock(), __ast_rwlock_tryrdlock(), __ast_rwlock_trywrlock(), and __ast_rwlock_wrlock().
#define AST_MUTEX_DEFINE_STATIC | ( | mutex | ) | __AST_MUTEX_DEFINE(static, mutex, AST_MUTEX_INIT_VALUE, 1) |
Definition at line 518 of file lock.h.
Referenced by ast_crypt_validate().
#define AST_MUTEX_DEFINE_STATIC_NOTRACKING | ( | mutex | ) | __AST_MUTEX_DEFINE(static, mutex, AST_MUTEX_INIT_VALUE_NOTRACKING, 0) |
#define ast_mutex_destroy | ( | a | ) | __ast_pthread_mutex_destroy(__FILE__, __LINE__, __PRETTY_FUNCTION__, #a, a) |
Definition at line 186 of file lock.h.
Referenced by __ao2_ref(), __ast_internal_context_destroy(), __unload_module(), ast_audiohook_destroy(), ast_autochan_destroy(), ast_bridge_impart(), ast_dial_destroy(), ast_dnsmgr_release(), ast_sched_context_destroy(), ast_sip_push_task_wait(), ast_speech_destroy(), ast_speech_new(), AST_TEST_DEFINE(), async_data_destructor(), async_datastore_data_destroy(), async_minimal_data_destructor(), auth_http_callback(), build_conf(), build_gateway(), cel_verify_and_cleanup_cb(), chan_list_destructor(), close_client(), command_dtor(), complex_task_data_free(), conf_free(), data_cleanup(), delete_device(), delete_peers(), delete_users(), destroy_dahdi_pvt(), destroy_endpoint(), destroy_session(), destroy_table(), dispatch_message(), dns_synchronous_resolve_destroy(), do_monitor(), find_idle_thread(), find_realtime(), free_config(), generic_http_callback(), get_lock(), hangup_data_destroy(), iax2_process_thread_cleanup(), init_logger(), load_module(), mgcp_prune_realtime_gateway(), misdn_cfg_destroy(), misdn_jb_destroy(), mixmonitor_free(), odbc_class_destructor(), off_nominal_async_data_destructor(), ooh323_destroy(), ooh323c_call_thread(), ooh323c_start_call_thread(), playback_task_data_destroy(), prometheus_metric_free(), query_set_data_destructor(), recurring_data_destructor(), resolver_data_cleanup(), session_destructor(), session_do(), setup_mixmonitor_ds(), shutdown_data_dtor(), simple_task_data_free(), sla_destroy(), sla_handle_dial_state_event(), sla_station_exec(), smdi_interface_destroy(), softmix_bridge_data_destroy(), softmix_bridge_leave(), start_network_thread(), stasis_message_sink_dtor(), task_data_dtor(), test_shutdown(), timing_read(), unistim_free_sub(), unload_module(), vm_allocate_dh(), and worker_thread_destroy().
#define ast_mutex_init | ( | pmutex | ) | __ast_pthread_mutex_init(1, __FILE__, __LINE__, __PRETTY_FUNCTION__, #pmutex, pmutex) |
Definition at line 184 of file lock.h.
Referenced by accept_thread(), add_notify(), alloc_profile(), alloc_smdi_interface(), ast_audiohook_init(), ast_autochan_setup(), ast_bridge_impart(), ast_context_find_or_create(), ast_dial_create(), ast_dns_resolve(), ast_dnsmgr_get_family(), ast_query_set_resolve(), ast_sched_context_create(), ast_sip_push_task_wait(), ast_speech_new(), ast_ssl_init(), AST_TEST_DEFINE(), async_data_alloc(), async_datastore_data_alloc(), async_minimal_data_alloc(), auth_http_callback(), available(), build_conf(), build_device(), build_gateway(), build_mansession(), build_peer(), build_user(), caldav_load_calendar(), command_create(), complex_task_data_alloc(), conf_run(), config_device(), config_line(), config_parse_variables(), create_client(), dispatch_message(), duplicate_pseudo(), ewscal_load_calendar(), exchangecal_load_calendar(), find_idle_thread(), find_table(), find_tpeer(), generic_http_callback(), get_lock(), hangup_data_init(), ical_load_calendar(), init_logger(), init_timing_thread(), internal_ao2_alloc(), load_config(), load_module(), load_odbc_config(), mbl_load_device(), misdn_cfg_init(), misdn_jb_init(), mkintf(), off_nominal_async_data_alloc(), ooh323_alloc(), ooh323c_start_call_thread(), parse_config(), playback_task_data_init(), prometheus_metric_create(), query_set_data_alloc(), rcv_mac_addr(), read_config(), recurring_data_alloc(), resolver_data_init(), scheduler(), session_do(), setup_mixmonitor_ds(), shutdown_data_create(), simple_task_data_alloc(), sla_handle_dial_state_event(), sla_load_config(), sla_station_exec(), softmix_bridge_create(), softmix_bridge_join(), start_network_thread(), stasis_message_sink_create(), task_data_create(), test_alloc(), test_cel_init_cb(), unistim_alloc_sub(), vm_allocate_dh(), and worker_thread_alloc().
#define ast_mutex_init_notracking | ( | pmutex | ) | __ast_pthread_mutex_init(0, __FILE__, __LINE__, __PRETTY_FUNCTION__, #pmutex, pmutex) |
#define AST_MUTEX_INIT_VALUE { PTHREAD_MUTEX_INIT_VALUE, NULL, {1, 0} } |
#define AST_MUTEX_INIT_VALUE_NOTRACKING { PTHREAD_MUTEX_INIT_VALUE, NULL, {0, 0} } |
#define AST_MUTEX_INITIALIZER __use_AST_MUTEX_DEFINE_STATIC_rather_than_AST_MUTEX_INITIALIZER__ |
#define AST_MUTEX_KIND PTHREAD_MUTEX_RECURSIVE_NP |
Definition at line 77 of file lock.h.
Referenced by __ast_pthread_mutex_init(), ast_get_reentrancy(), and dummy_start().
#define ast_mutex_lock | ( | a | ) | __ast_pthread_mutex_lock(__FILE__, __LINE__, __PRETTY_FUNCTION__, #a, a) |
Definition at line 187 of file lock.h.
Referenced by __attempt_transmit(), __auth_reject(), __auto_congest(), __auto_hangup(), __dahdi_exception(), __find_callno(), __get_from_jb(), __iax2_poke_noanswer(), __manager_event_sessions_va(), __reload(), __unload_module(), _ast_odbc_request_obj2(), acf_channel_read(), acf_jabberreceive_read(), acl_change_stasis_cb(), action_dahdishowchannels(), action_waitevent(), add_notify(), adsi_delete(), adsi_message(), alsa_answer(), alsa_call(), alsa_digit(), alsa_fixup(), alsa_hangup(), alsa_indicate(), alsa_read(), alsa_request(), alsa_text(), alsa_write(), amihook_helper(), analog_ss_thread(), announce_thread(), answer_exec_run(), app_exec(), append_mailbox_mapping(), ast_ari_remove_handler(), ast_autochan_new_channel(), ast_begin_shutdown(), ast_cancel_shutdown(), ast_cli_netstats(), ast_context_lockmacro(), ast_db_del(), ast_db_deltree(), ast_db_gettree(), ast_db_gettree_by_prefix(), ast_db_put(), ast_dial_join(), ast_dns_get_nameservers(), ast_dns_resolve(), ast_dnsmgr_changed(), ast_file_read_dirs(), ast_get_enum(), ast_iax2_new(), ast_merge_contexts_and_delete(), ast_monitor_start(), ast_odbc_direct_execute(), ast_odbc_prepare_and_execute(), ast_odbc_release_obj(), ast_pjproject_log_intercept_begin(), ast_query_set_resolve(), ast_random(), ast_rdlock_contexts(), ast_replace_sigchld(), ast_sched_add_variable(), ast_sched_clean_by_callback(), ast_sched_context_destroy(), ast_sched_del(), ast_sched_dump(), ast_sched_find_data(), ast_sched_report(), ast_sched_runq(), ast_sched_wait(), ast_sched_when(), ast_search_dns(), ast_sip_push_task_wait(), ast_smdi_md_message_push(), ast_smdi_mwi_message_push(), AST_TEST_DEFINE(), ast_unreplace_sigchld(), ast_verb_update(), ast_wrlock_contexts(), astdb_atexit(), async_callback(), async_play_sound_ready(), attempt_transfer(), auth_reject(), authenticate_reply(), auto_hangup(), blr_ebl(), blr_txt(), bridge_agent_hold_deferred_create(), bridge_channel_impart_ds_head_signal(), bridge_channel_impart_wait(), build_device(), build_reply_digest(), caldav_load_calendar(), can_safely_quit(), cb_events(), cdr_detach(), cdr_handler(), cdr_submit_batch(), chan_test_devicestate_cb(), channel_to_session(), check_unloading(), cl_dequeue_chan(), cl_queue_chan(), clear_history_entries(), clear_result_states(), clear_talking(), cli_tps_ping(), close_client(), close_mailbox(), close_rtp_connection(), close_udptl_connection(), command_complete(), command_join(), conf_free(), conf_run(), config_device(), config_handler(), config_line(), config_load(), config_module(), config_pgsql(), console_answer(), console_autoanswer(), console_dial(), console_hangup(), console_sendtext(), create_channel_name(), create_client(), csv_log(), custom_log(), dahdi_answer(), dahdi_call(), dahdi_cc_callback(), dahdi_create_channel_range(), dahdi_destroy_channel_range(), dahdi_digit_begin(), dahdi_digit_end(), dahdi_exception(), dahdi_fixup(), dahdi_func_read(), dahdi_func_write(), dahdi_handle_dtmf(), dahdi_handle_event(), dahdi_hangup(), dahdi_iflist_extract(), dahdi_indicate(), dahdi_master_slave_unlink(), dahdi_request(), dahdi_restart(), dahdi_sendtext(), dahdi_set_dnd(), dahdi_set_hwgain(), dahdi_set_swgain(), dahdi_show_channel(), dahdi_show_channels(), dahdi_softhangup_all(), dahdi_write(), db_create_astdb(), db_get_common(), db_open(), db_sync_thread(), decrease_call_count(), defer_full_frame(), DEFINE_SQL_STATEMENT(), delete_peers(), delete_users(), destroy_all_channels(), destroy_all_mailbox_mappings(), destroy_conference_bridge(), destroy_endpoint(), destroy_monitor_audiohook(), destroy_pgsql(), destroy_session(), destroy_table(), device_state_cb(), dial_trunk(), dispatch_exec_sync(), dispatch_message(), dns_advance_field(), dns_synchronous_resolve_callback(), dnsmgr_refresh(), do_cdr(), do_discovery(), do_monitor(), do_monitor_headset(), do_monitor_phone(), do_refresh(), do_reload(), do_timing(), dp_lookup(), dump_cmd_queues(), dump_queue(), ewscal_load_calendar(), exchangecal_load_calendar(), filter_history(), find_call(), find_chan_by_bc(), find_channel(), find_command(), find_database(), find_friend(), find_hold_active_call(), find_hold_call(), find_hold_call_l3(), find_idle_thread(), find_peer(), find_subchannel_and_lock(), find_subchannel_by_name(), find_table(), find_tpeer(), find_user(), finish_bookmark(), function_ooh323_read(), function_ooh323_write(), generate_uuid(), generic_http_callback(), get_chan_by_ast_name(), get_dial_bridge(), get_input(), get_lock(), get_unused_callno(), handle_capabilities_res_message(), handle_clear_alarms(), handle_cli_database_query(), handle_cli_database_show(), handle_cli_database_showkey(), handle_cli_dialplan_save(), handle_cli_iax2_show_channels(), handle_cli_iax2_show_stats(), handle_cli_locks_show(), handle_cli_misdn_show_channel(), handle_cli_misdn_show_channels(), handle_cli_mobile_cusd(), handle_cli_mobile_rfcomm(), handle_cli_mobile_show_devices(), handle_cli_odbc_show(), handle_cli_ooh323_reload(), handle_cli_ooh323_show_peer(), handle_cli_ooh323_show_peers(), handle_cli_ooh323_show_user(), handle_cli_ooh323_show_users(), handle_cli_osp_show(), handle_cli_realtime_pgsql_status(), handle_deferred_full_frames(), handle_init_event(), handle_mgcp_audit_endpoint(), handle_mgcp_show_endpoints(), handle_modlist(), handle_request(), handle_request_do(), handle_speechrecognize(), handler_wait_for_message(), hangup_playback(), headset_send_ring(), history_on_rx_msg(), history_on_tx_msg(), http_callback(), iax2_call(), iax2_do_register(), iax2_fixup(), iax2_hangup(), iax2_indicate(), iax2_key_rotate(), iax2_lock_callno_unless_destroyed(), iax2_poke_peer(), iax2_process_thread(), iax2_queryoption(), iax2_setoption(), iax2_write(), iax_process_template(), iax_prov_complete_template(), iax_provision_build(), iax_provision_free_templates(), iax_provision_version(), iax_show_provisioning(), iax_template_parse(), ical_load_calendar(), increase_call_count(), inotify_daemon(), key_main_page(), key_select_extension(), leave_voicemail(), load_config(), load_module(), load_values_config(), lock_free(), lock_it(), lock_msg_q(), log_jitterstats(), lua_free_extensions(), lua_load_extensions(), lua_reload_extensions(), make_trunk(), mansession_lock(), mb_poll_thread(), mbl_answer(), mbl_call(), mbl_devicestate(), mbl_digit_end(), mbl_fixup(), mbl_hangup(), mbl_request(), mbl_sendsms_exec(), mbl_status_exec(), meetme_menu_admin_extended(), mgcp_answer(), mgcp_call(), mgcp_devicestate(), mgcp_fixup(), mgcp_hangup(), mgcp_indicate(), mgcp_pktcgate_open(), mgcp_pktcgate_remove(), mgcp_postrequest(), mgcp_prune_realtime_gateway(), mgcp_read(), mgcp_reload(), mgcp_senddigit_begin(), mgcp_senddigit_end(), mgcp_write(), mgcpsock_read(), mid_test_sync(), minimal_callback(), misdn_cfg_lock(), misdn_chan_is_valid(), misdn_hangup(), misdn_jb_empty(), misdn_jb_fill(), misdn_overlap_dial_task(), mixmonitor_ds_destroy(), mixmonitor_thread(), mwi_monitor_handler(), my_decrease_ss_count(), my_handle_dtmf(), my_increase_ss_count(), my_lock_private(), MYSQL_exec(), mysql_log(), native_bridge_is_capable(), native_start(), native_stop(), nominal_async_run(), off_nominal_async_callback(), off_nominal_async_run(), onAlerting(), onCallCleared(), onCallEstablished(), onModeChanged(), onNewCallCreated(), onOutgoingCall(), onProgress(), ooh323_alloc(), ooh323_answer(), ooh323_call(), ooh323_delete_peer(), ooh323_destroy(), ooh323_digit_begin(), ooh323_digit_end(), ooh323_do_reload(), ooh323_fixup(), ooh323_hangup(), ooh323_indicate(), ooh323_new(), ooh323_onReceivedDigit(), ooh323_onReceivedSetup(), ooh323_queryoption(), ooh323_read(), ooh323_request(), ooh323_set_read_format(), ooh323_set_rtp_peer(), ooh323_set_write_format(), ooh323_write(), ooh323c_call_thread(), ooh323c_start_call_thread(), osp_create_provider(), osp_create_transaction(), osp_get_provider(), osp_unload(), parse_config(), parsing(), pbx_load_module(), peer_destructor(), pgsql_log(), phone_request(), pjsip_show_history(), play_message(), play_message_by_id_helper(), play_sound_helper(), playback_task(), presence_state_cb(), private_enum_init(), prometheus_scrape_to_string(), prune_gateways(), pthread_timer_open(), publish_msg(), pvt_destructor(), query_set_callback(), query_set_test(), queue_ringing_trunk(), rcv_mac_addr(), realtime_destroy_handler(), realtime_handler(), realtime_ldap_base_ap(), realtime_multi_handler(), realtime_multi_pgsql(), realtime_pgsql(), realtime_store_handler(), realtime_update2_handler(), realtime_update_handler(), recordthread(), recurring_cancel(), register_verify(), registry_authrequest(), registry_message_cb(), release_chan(), release_chan_early(), reload(), reload_config(), reload_followme(), reload_module(), replace_callno(), reqprep(), require_pgsql(), resolution_thread(), restart_monitor(), restart_pktc_thread(), retrans_pkt(), run_station(), save_to_folder(), sched_run(), sched_thread_destroy(), schedule_cache_expiration(), schedule_calendar_event(), scheduled_destroy(), sco_accept(), scrape_metrics(), send_client(), send_command_locked(), send_request(), send_retransmit(), set_hangup_source_and_cause(), set_pvt_defaults(), set_softmix_bridge_data(), set_unloading(), setup_dahdi_int(), setup_rtp_connection(), setup_rtp_remote(), setup_udptl_connection(), signal_condition(), sip_reload(), sip_show_settings(), skinny_session(), sla_destroy(), sla_handle_dial_state_event(), sla_handle_ringing_trunk_event(), sla_hangup_stations(), sla_queue_event_full(), sla_station_exec(), sla_thread(), sla_trunk_exec(), socket_process_helper(), softmix_bridge_destroy(), softmix_bridge_stop(), softmix_bridge_write_rtcp(), softmix_bridge_write_video(), softmix_bridge_write_voice(), softmix_mixing_loop(), softmix_mixing_thread(), softmix_poke_thread(), spandsp_fax_cli_show_stats(), speech_background(), ssl_lock(), start_batch_mode(), start_network_thread(), start_rtp(), stasis_app_control_shutdown(), statistics_show_messages(), stop_mixmonitor_full(), stop_poll_thread(), store_pgsql(), stun_monitor_request(), stun_stop_monitor(), sync_task(), syslog_log(), task_1(), tds_load_module(), tds_log(), tds_unload_module(), test_cancel(), test_msg_handle_msg_cb(), timing_read(), tps_ping_handler(), transmit_frame(), transmit_response_bysession(), unistim_fixup(), unistim_hangup_clean(), unistim_read(), unistim_register(), unistim_show_devices(), unistim_show_info(), unistim_write(), unistimsock_read(), unload_module(), unlock_read(), update2_ldap(), update2_pgsql(), update_pgsql(), update_registry(), user_event_hook_cb(), user_event_wait_for_events(), vm_allocate_dh(), vm_execmain(), vm_instructions_en(), vm_instructions_ja(), wait_for_channel_callback(), wait_for_device_state_updates(), wait_for_hook(), wait_for_initiator(), wait_for_resolution(), wait_until_thread_state_task_pushed(), worker_start(), write_cel(), and xmpp_pak_message().
#define ast_mutex_trylock | ( | a | ) | __ast_pthread_mutex_trylock(__FILE__, __LINE__, __PRETTY_FUNCTION__, #a, a) |
Definition at line 189 of file lock.h.
Referenced by ast_cli_perms_init(), ast_module_reload(), cache_get_callno_locked(), dahdi_master_slave_unlink(), dahdi_read(), iax2_key_rotate(), mbl_read(), mbl_write(), mgcp_prune_realtime_gateway(), native_start(), ooh323c_start_call_thread(), refresh_list(), socket_process_helper(), and unload_module().
#define ast_mutex_unlock | ( | a | ) | __ast_pthread_mutex_unlock(__FILE__, __LINE__, __PRETTY_FUNCTION__, #a, a) |
Definition at line 188 of file lock.h.
Referenced by __attempt_transmit(), __auth_reject(), __auto_congest(), __auto_hangup(), __dahdi_exception(), __find_callno(), __get_from_jb(), __iax2_poke_noanswer(), __manager_event_sessions_va(), __reload(), __send_lagrq(), __send_ping(), __unload_module(), _ast_odbc_request_obj2(), acf_channel_read(), acf_jabberreceive_read(), acl_change_stasis_cb(), action_dahdishowchannels(), action_waitevent(), add_notify(), adsi_delete(), adsi_message(), alsa_answer(), alsa_call(), alsa_digit(), alsa_fixup(), alsa_hangup(), alsa_indicate(), alsa_read(), alsa_request(), alsa_text(), alsa_write(), amihook_helper(), analog_ss_thread(), announce_thread(), answer_exec_run(), app_exec(), append_mailbox_mapping(), ast_ari_remove_handler(), ast_autochan_new_channel(), ast_begin_shutdown(), ast_cancel_shutdown(), ast_change_hint(), ast_cli_netstats(), ast_cli_perms_init(), ast_context_unlockmacro(), ast_db_del(), ast_db_deltree(), ast_db_gettree(), ast_db_gettree_by_prefix(), ast_db_put(), ast_dial_join(), ast_dns_get_nameservers(), ast_dns_resolve(), ast_dnsmgr_changed(), ast_file_read_dirs(), ast_get_enum(), ast_iax2_new(), ast_merge_contexts_and_delete(), ast_module_reload(), ast_monitor_start(), ast_odbc_direct_execute(), ast_odbc_prepare_and_execute(), ast_odbc_release_obj(), ast_pjproject_log_intercept_end(), ast_query_set_resolve(), ast_random(), ast_replace_sigchld(), ast_sched_add_variable(), ast_sched_clean_by_callback(), ast_sched_context_destroy(), ast_sched_del(), ast_sched_dump(), ast_sched_find_data(), ast_sched_report(), ast_sched_runq(), ast_sched_wait(), ast_sched_when(), ast_search_dns(), ast_sip_push_task_wait(), ast_smdi_md_message_push(), ast_smdi_mwi_message_push(), AST_TEST_DEFINE(), ast_unlock_contexts(), ast_unreplace_sigchld(), ast_verb_update(), astdb_atexit(), async_callback(), async_play_sound_ready(), attempt_transfer(), auth_reject(), authenticate_reply(), auto_hangup(), blr_ebl(), blr_txt(), bridge_agent_hold_deferred_create(), bridge_channel_impart_ds_head_signal(), bridge_channel_impart_wait(), build_device(), build_reply_digest(), cache_get_callno_locked(), caldav_load_calendar(), can_safely_quit(), cb_events(), cdr_detach(), cdr_handler(), cdr_submit_batch(), chan_test_devicestate_cb(), channel_to_session(), check_unloading(), cl_dequeue_chan(), cl_queue_chan(), clear_history_entries(), clear_result_states(), clear_talking(), cli_tps_ping(), close_client(), close_mailbox(), close_rtp_connection(), close_udptl_connection(), command_complete(), command_join(), conf_free(), conf_run(), config_device(), config_handler(), config_line(), config_load(), config_module(), config_pgsql(), configure_local_rtp(), console_answer(), console_autoanswer(), console_dial(), console_hangup(), console_sendtext(), create_channel_name(), create_client(), csv_log(), custom_log(), dahdi_answer(), dahdi_call(), dahdi_cc_callback(), dahdi_create_channel_range(), dahdi_destroy_channel_range(), dahdi_digit_begin(), dahdi_digit_end(), dahdi_exception(), dahdi_fixup(), dahdi_func_read(), dahdi_func_write(), dahdi_handle_dtmf(), dahdi_handle_event(), dahdi_hangup(), dahdi_iflist_extract(), dahdi_indicate(), dahdi_master_slave_unlink(), dahdi_read(), dahdi_request(), dahdi_restart(), dahdi_sendtext(), dahdi_set_dnd(), dahdi_set_hwgain(), dahdi_set_swgain(), dahdi_show_channel(), dahdi_show_channels(), dahdi_softhangup_all(), dahdi_write(), db_create_astdb(), db_get_common(), db_open(), db_sync_thread(), decrease_call_count(), defer_full_frame(), DEFINE_SQL_STATEMENT(), delete_peers(), delete_users(), destroy_all_channels(), destroy_all_mailbox_mappings(), destroy_conference_bridge(), destroy_endpoint(), destroy_monitor_audiohook(), destroy_pgsql(), destroy_session(), destroy_table(), device_state_cb(), dial_trunk(), dispatch_exec_sync(), dispatch_message(), dns_advance_field(), dns_synchronous_resolve_callback(), dnsmgr_refresh(), do_cdr(), do_discovery(), do_monitor(), do_monitor_headset(), do_monitor_phone(), do_refresh(), do_reload(), do_timing(), dp_lookup(), dump_cmd_queues(), dump_queue(), ewscal_load_calendar(), exchangecal_load_calendar(), filter_history(), find_cache(), find_call(), find_chan_by_bc(), find_channel(), find_command(), find_friend(), find_hold_active_call(), find_hold_call(), find_hold_call_l3(), find_idle_thread(), find_peer(), find_subchannel_and_lock(), find_subchannel_by_name(), find_table(), find_user(), finish_bookmark(), function_ooh323_read(), function_ooh323_write(), generate_uuid(), generic_http_callback(), get_chan_by_ast_name(), get_dial_bridge(), get_input(), get_lock(), get_unused_callno(), handle_capabilities_res_message(), handle_clear_alarms(), handle_cli_database_query(), handle_cli_database_show(), handle_cli_database_showkey(), handle_cli_dialplan_save(), handle_cli_iax2_show_channels(), handle_cli_iax2_show_stats(), handle_cli_locks_show(), handle_cli_misdn_show_channel(), handle_cli_misdn_show_channels(), handle_cli_mobile_cusd(), handle_cli_mobile_rfcomm(), handle_cli_mobile_show_devices(), handle_cli_odbc_show(), handle_cli_ooh323_reload(), handle_cli_ooh323_show_peer(), handle_cli_ooh323_show_peers(), handle_cli_ooh323_show_user(), handle_cli_ooh323_show_users(), handle_cli_osp_show(), handle_cli_realtime_pgsql_status(), handle_deferred_full_frames(), handle_init_event(), handle_mgcp_audit_endpoint(), handle_mgcp_show_endpoints(), handle_modlist(), handle_request(), handle_request_do(), handle_speechrecognize(), handler_wait_for_message(), hangup_playback(), headset_send_ring(), history_on_rx_msg(), history_on_tx_msg(), http_callback(), iax2_call(), iax2_do_register(), iax2_fixup(), iax2_hangup(), iax2_indicate(), iax2_key_rotate(), iax2_lock_callno_unless_destroyed(), iax2_poke_peer(), iax2_process_thread(), iax2_provision(), iax2_queryoption(), iax2_request(), iax2_setoption(), iax2_trunk_queue(), iax2_write(), iax_process_template(), iax_prov_complete_template(), iax_provision_build(), iax_provision_free_templates(), iax_provision_version(), iax_show_provisioning(), iax_template_parse(), ical_load_calendar(), increase_call_count(), inotify_daemon(), key_main_page(), key_select_extension(), ldap_loadentry(), leave_voicemail(), load_config(), load_module(), load_values_config(), lock_free(), log_jitterstats(), lua_free_extensions(), lua_load_extensions(), lua_reload_extensions(), make_trunk(), mansession_unlock(), mb_poll_thread(), mbl_answer(), mbl_call(), mbl_devicestate(), mbl_digit_end(), mbl_fixup(), mbl_hangup(), mbl_read(), mbl_request(), mbl_sendsms_exec(), mbl_status_exec(), mbl_write(), meetme_menu_admin_extended(), mgcp_answer(), mgcp_call(), mgcp_devicestate(), mgcp_fixup(), mgcp_hangup(), mgcp_indicate(), mgcp_pktcgate_open(), mgcp_pktcgate_remove(), mgcp_postrequest(), mgcp_prune_realtime_gateway(), mgcp_read(), mgcp_reload(), mgcp_request(), mgcp_senddigit_begin(), mgcp_senddigit_end(), mgcp_write(), mgcpsock_read(), mid_test_sync(), minimal_callback(), misdn_cfg_unlock(), misdn_chan_is_valid(), misdn_hangup(), misdn_jb_empty(), misdn_jb_fill(), misdn_overlap_dial_task(), mixmonitor_ds_destroy(), mixmonitor_thread(), mwi_monitor_handler(), my_decrease_ss_count(), my_handle_dtmf(), my_increase_ss_count(), my_unlock_private(), MYSQL_exec(), mysql_log(), native_bridge_is_capable(), native_start(), native_stop(), nominal_async_run(), off_nominal_async_callback(), off_nominal_async_run(), onAlerting(), onCallCleared(), onCallEstablished(), onModeChanged(), onNewCallCreated(), onOutgoingCall(), onProgress(), ooh323_alloc(), ooh323_answer(), ooh323_call(), ooh323_delete_peer(), ooh323_destroy(), ooh323_digit_begin(), ooh323_digit_end(), ooh323_do_reload(), ooh323_fixup(), ooh323_hangup(), ooh323_indicate(), ooh323_new(), ooh323_onReceivedDigit(), ooh323_onReceivedSetup(), ooh323_queryoption(), ooh323_read(), ooh323_request(), ooh323_set_read_format(), ooh323_set_rtp_peer(), ooh323_set_write_format(), ooh323_write(), ooh323c_call_thread(), ooh323c_start_call_thread(), osp_create_provider(), osp_create_transaction(), osp_get_provider(), osp_unload(), parse_config(), parsing(), pbx_load_module(), peer_destructor(), pgsql_log(), phone_request(), pjsip_show_history(), play_message(), play_message_by_id_helper(), play_sound_helper(), playback_task(), presence_state_cb(), private_enum_init(), prometheus_scrape_to_string(), prune_gateways(), pthread_timer_open(), publish_msg(), pvt_destructor(), query_set_callback(), query_set_test(), queue_ringing_trunk(), rcv_mac_addr(), realtime_destroy_handler(), realtime_handler(), realtime_ldap_base_ap(), realtime_multi_handler(), realtime_multi_pgsql(), realtime_pgsql(), realtime_store_handler(), realtime_update2_handler(), realtime_update_handler(), recordthread(), recurring_cancel(), refresh_list(), register_verify(), registry_authrequest(), registry_message_cb(), release_chan(), release_chan_early(), release_table(), reload(), reload_config(), reload_followme(), reload_module(), replace_callno(), reqprep(), require_pgsql(), resolution_thread(), restart_monitor(), restart_pktc_thread(), retrans_pkt(), run_station(), save_to_folder(), sched_run(), sched_thread_destroy(), schedule_cache_expiration(), schedule_calendar_event(), scheduled_destroy(), sco_accept(), scrape_metrics(), send_client(), send_command_locked(), send_request(), send_retransmit(), set_hangup_source_and_cause(), set_pvt_defaults(), set_softmix_bridge_data(), set_unloading(), setup_dahdi_int(), setup_rtp_connection(), setup_rtp_remote(), setup_udptl_connection(), signal_condition(), sip_reload(), sip_show_settings(), skinny_session(), skinny_session_cleanup(), sla_destroy(), sla_handle_dial_state_event(), sla_handle_ringing_trunk_event(), sla_hangup_stations(), sla_queue_event_full(), sla_station_exec(), sla_thread(), sla_trunk_exec(), socket_process_helper(), socket_process_meta(), softmix_bridge_destroy(), softmix_bridge_stop(), softmix_bridge_write_rtcp(), softmix_bridge_write_video(), softmix_bridge_write_voice(), softmix_mixing_loop(), softmix_mixing_thread(), softmix_poke_thread(), spandsp_fax_cli_show_stats(), speech_background(), ssl_lock(), start_batch_mode(), start_network_thread(), start_rtp(), stasis_app_control_shutdown(), statistics_show_messages(), stop_mixmonitor_full(), stop_poll_thread(), store_pgsql(), stun_monitor_request(), stun_stop_monitor(), sync_task(), syslog_log(), task_1(), tds_load_module(), tds_log(), tds_unload_module(), test_cancel(), test_msg_handle_msg_cb(), timing_read(), tps_ping_handler(), transmit_frame(), transmit_response_bysession(), unistim_fixup(), unistim_hangup_clean(), unistim_read(), unistim_register(), unistim_show_devices(), unistim_show_info(), unistim_write(), unistimsock_read(), unload_module(), unlock_it(), unlock_msg_q(), unlock_read(), update2_ldap(), update2_pgsql(), update_pgsql(), update_registry(), user_event_hook_cb(), user_event_wait_for_events(), vm_allocate_dh(), vm_execmain(), vm_instructions_en(), vm_instructions_ja(), wait_for_channel_callback(), wait_for_device_state_updates(), wait_for_hook(), wait_for_initiator(), wait_for_resolution(), wait_until_thread_state_task_pushed(), worker_start(), write_cel(), and xmpp_pak_message().
#define AST_PTHREADT_NULL (pthread_t) -1 |
Definition at line 66 of file lock.h.
Referenced by __allocate_taskprocessor(), __ast_rwlock_unlock(), __manager_event_sessions_va(), __sip_reliable_xmit(), __unload_module(), accept_thread(), action_dahdishowchannels(), action_waitevent(), actual_load_config(), add_notify(), ast_autoservice_start(), ast_autoservice_stop(), ast_console_puts_mutable_full(), ast_devstate_changed_literal(), ast_dial_create(), ast_dial_join(), ast_localtime_wakeup_monitor(), ast_log_full(), ast_pjproject_log_intercept_end(), ast_safe_fork(), ast_sched_start_thread(), ast_sip_destroy_transport_management(), ast_taskprocessor_execute(), ast_tcptls_server_start(), ast_tcptls_server_stop(), ast_xmpp_client_disconnect(), autoservice_run(), autoservice_shutdown(), bridge_manager_create(), bridge_manager_destroy(), build_calendar(), build_conf(), build_mansession(), calendar_event_notify(), cdr_enable_batch_mode(), cdr_submit_batch(), cleanup_module(), close_logger(), conf_free(), conf_run(), dahdi_cc_callback(), dahdi_destroy_channel_range(), dahdi_restart(), default_listener_pvt_alloc(), default_listener_shutdown(), destroy_session(), device_state_engine_cleanup(), do_reload(), expiration_global_loaded(), finalize_batch_mode(), generic_http_callback(), get_input(), handle_call_outgoing(), init_pvt(), inotify_daemon(), keepalive_global_loaded(), mbl_load_device(), meetme_menu_admin_extended(), moh_class_destructor(), monitor_sig_flags(), ooh323c_stop_call_thread(), ooh323c_stop_stack_thread(), really_quit(), restart_monitor(), restart_pktc_thread(), sched_thread_destroy(), setup_dahdi_int(), sla_destroy(), sla_load_config(), sla_queue_event_full(), smdi_interface_destroy(), smdi_load(), softmix_bridge_create(), softmix_bridge_destroy(), sorcery_memory_cache_thrash_create(), sorcery_memory_cache_thrash_stop(), start_monitor(), stop_poll_thread(), stop_stream(), unbound_resolver_alloc(), unbound_resolver_start(), unbound_resolver_stop(), unistim_alloc_sub(), unload_module(), worker_shutdown(), worker_thread_alloc(), and xmpp_client_alloc().
#define AST_PTHREADT_STOP (pthread_t) -2 |
Definition at line 67 of file lock.h.
Referenced by __unload_module(), answer_exec_run(), ast_dial_join(), dahdi_restart(), monitor_dial(), restart_monitor(), restart_pktc_thread(), smdi_interface_destroy(), unbound_resolver_stop(), unbound_resolver_thread(), and unload_module().
#define AST_RWLOCK_DEFINE_STATIC | ( | rwlock | ) | __AST_RWLOCK_DEFINE(static, rwlock, AST_RWLOCK_INIT_VALUE, 1) |
#define AST_RWLOCK_DEFINE_STATIC_NOTRACKING | ( | rwlock | ) | __AST_RWLOCK_DEFINE(static, rwlock, AST_RWLOCK_INIT_VALUE_NOTRACKING, 0) |
#define ast_rwlock_destroy | ( | rwlock | ) | __ast_rwlock_destroy(__FILE__, __LINE__, __PRETTY_FUNCTION__, #rwlock, rwlock) |
Definition at line 231 of file lock.h.
Referenced by __ao2_ref(), __ast_internal_context_destroy(), ast_hashtab_destroy(), ast_hashtab_destroylock(), ast_heap_destroy(), ast_rtp_codecs_payloads_destroy(), destroy_table(), message_shutdown(), messaging_cleanup(), messaging_init(), sorcery_config_destructor(), and translate_shutdown().
#define ast_rwlock_init | ( | rwlock | ) | __ast_rwlock_init(1, __FILE__, __LINE__, __PRETTY_FUNCTION__, #rwlock, rwlock) |
wrapper for rwlock with tracking enabled
Definition at line 222 of file lock.h.
Referenced by _ast_hashtab_create(), _ast_hashtab_dup(), _ast_heap_create(), ast_context_find_or_create(), ast_hashtab_initlock(), ast_msg_init(), ast_rtp_codecs_payloads_initialize(), ast_rtp_engine_init(), ast_translate_init(), find_table(), internal_ao2_alloc(), messaging_init(), and sorcery_config_open().
#define ast_rwlock_init_notracking | ( | rwlock | ) | __ast_rwlock_init(0, __FILE__, __LINE__, __PRETTY_FUNCTION__, #rwlock, rwlock) |
#define AST_RWLOCK_INIT_VALUE { __AST_RWLOCK_INIT_VALUE, NULL, {1, 0} } |
#define AST_RWLOCK_INIT_VALUE_NOTRACKING { __AST_RWLOCK_INIT_VALUE, NULL, {0, 0} } |
#define ast_rwlock_rdlock | ( | a | ) | __ast_rwlock_rdlock(__FILE__, __LINE__, __PRETTY_FUNCTION__, a, #a) |
Definition at line 233 of file lock.h.
Referenced by _ast_hashtab_start_traversal(), action_messagesend(), allowed_on_shutdown(), ast_adsi_available(), ast_adsi_begin_download(), ast_adsi_channel_restore(), ast_adsi_clear_screen(), ast_adsi_clear_soft_keys(), ast_adsi_connect_session(), ast_adsi_data_mode(), ast_adsi_disconnect_session(), ast_adsi_display(), ast_adsi_download_connect(), ast_adsi_download_disconnect(), ast_adsi_end_download(), ast_adsi_get_cpeid(), ast_adsi_get_cpeinfo(), ast_adsi_input_control(), ast_adsi_input_format(), ast_adsi_load_session(), ast_adsi_load_soft_key(), ast_adsi_print(), ast_adsi_query_cpeid(), ast_adsi_query_cpeinfo(), ast_adsi_read_encoded_dtmf(), ast_adsi_set_keys(), ast_adsi_set_line(), ast_adsi_transmit_message(), ast_adsi_transmit_message_full(), ast_adsi_unload_session(), ast_adsi_voice_mode(), ast_calendar_config_acquire(), ast_hashtab_get_stats(), ast_hashtab_lookup(), ast_hashtab_lookup_with_hash(), ast_hashtab_rdlock(), ast_msg_has_destination(), ast_msg_send(), ast_rdlock_context(), ast_rtp_codecs_find_payload_code(), ast_rtp_codecs_get_framing(), ast_rtp_codecs_get_payload(), ast_rtp_codecs_get_payload_format(), ast_rtp_codecs_get_stream_type(), ast_rtp_codecs_payload_code(), ast_rtp_codecs_payload_code_tx(), ast_rtp_codecs_payload_formats(), ast_rtp_codecs_payloads_set_m_type(), ast_rtp_codecs_payloads_set_rtpmap_type_rate(), ast_rtp_lookup_mime_subtype2(), ast_rtp_lookup_sample_rate2(), ast_str_retrieve_variable(), ast_taskprocessor_alert_get(), beanstalk_put(), cel_bs_put(), codec_to_index(), corosync_show_config(), cpg_confchg_cb(), cpg_deliver_cb(), find_table(), get_active_pvt(), get_general_options(), get_odbc_obj(), get_subscription(), handle_msg_cb(), handle_show_globals(), has_destination_cb(), index2codec(), manager_log(), msg_q_cb(), msg_send_exec(), pbx_builtin_getvar_helper(), rtp_address_is_ice_blacklisted(), and stun_address_is_blacklisted().
#define ast_rwlock_tryrdlock | ( | a | ) | __ast_rwlock_tryrdlock(__FILE__, __LINE__, __PRETTY_FUNCTION__, a, #a) |
Definition at line 235 of file lock.h.
Referenced by ast_rtp_codecs_payloads_copy(), ast_rtp_codecs_payloads_xover(), corosync_show_members(), dispatch_thread_handler(), publish_event_to_corosync(), and send_cluster_notify().
#define ast_rwlock_trywrlock | ( | a | ) | __ast_rwlock_trywrlock(__FILE__, __LINE__, __PRETTY_FUNCTION__, a, #a) |
Definition at line 236 of file lock.h.
Referenced by cleanup_module(), dispatch_thread_handler(), and load_module().
#define ast_rwlock_unlock | ( | a | ) | __ast_rwlock_unlock(__FILE__, __LINE__, __PRETTY_FUNCTION__, a, #a) |
Definition at line 232 of file lock.h.
Referenced by _ast_hashtab_insert_immediate(), _ast_hashtab_insert_safe(), action_messagesend(), add_codec2index(), add_static_payload(), allowed_on_shutdown(), ast_adsi_available(), ast_adsi_begin_download(), ast_adsi_channel_restore(), ast_adsi_clear_screen(), ast_adsi_clear_soft_keys(), ast_adsi_connect_session(), ast_adsi_data_mode(), ast_adsi_disconnect_session(), ast_adsi_display(), ast_adsi_download_connect(), ast_adsi_download_disconnect(), ast_adsi_end_download(), ast_adsi_get_cpeid(), ast_adsi_get_cpeinfo(), ast_adsi_input_control(), ast_adsi_input_format(), ast_adsi_install_funcs(), ast_adsi_load_session(), ast_adsi_load_soft_key(), ast_adsi_print(), ast_adsi_query_cpeid(), ast_adsi_query_cpeinfo(), ast_adsi_read_encoded_dtmf(), ast_adsi_set_keys(), ast_adsi_set_line(), ast_adsi_transmit_message(), ast_adsi_transmit_message_full(), ast_adsi_unload_session(), ast_adsi_voice_mode(), ast_calendar_config_acquire(), ast_calendar_config_release(), ast_cli_allow_at_shutdown(), ast_hashtab_destroy(), ast_hashtab_end_traversal(), ast_hashtab_get_stats(), ast_hashtab_lookup(), ast_hashtab_lookup_with_hash(), ast_hashtab_remove_object_via_lookup(), ast_hashtab_remove_this_object(), ast_hashtab_unlock(), ast_msg_handler_register(), ast_msg_handler_unregister(), ast_msg_has_destination(), ast_msg_send(), ast_msg_tech_register(), ast_msg_tech_unregister(), ast_rtp_codecs_find_payload_code(), ast_rtp_codecs_get_framing(), ast_rtp_codecs_get_payload(), ast_rtp_codecs_get_payload_format(), ast_rtp_codecs_get_stream_type(), ast_rtp_codecs_payload_code(), ast_rtp_codecs_payload_code_tx(), ast_rtp_codecs_payload_formats(), ast_rtp_codecs_payload_replace_format(), ast_rtp_codecs_payloads_copy(), ast_rtp_codecs_payloads_set_m_type(), ast_rtp_codecs_payloads_set_rtpmap_type_rate(), ast_rtp_codecs_payloads_unset(), ast_rtp_codecs_payloads_xover(), ast_rtp_codecs_set_framing(), ast_rtp_engine_unload_format(), ast_rtp_lookup_mime_subtype2(), ast_rtp_lookup_sample_rate2(), ast_str_retrieve_variable(), ast_taskprocessor_alert_get(), ast_unlock_context(), beanstalk_put(), cel_bs_put(), cleanup_module(), codec_to_index(), corosync_show_config(), corosync_show_members(), cpg_confchg_cb(), cpg_deliver_cb(), destroy_pvts(), destroy_table(), dispatch_thread_handler(), get_active_pvt(), get_general_options(), get_odbc_obj(), get_or_create_subscription(), get_subscription(), handle_msg_cb(), handle_show_globals(), has_destination_cb(), index2codec(), load_config(), load_general_config(), load_module(), load_tech_calendars(), manager_log(), matrix_resize(), messaging_app_unsubscribe_endpoint(), msg_q_cb(), msg_send_exec(), pbx_builtin_clear_globals(), pbx_builtin_getvar_helper(), pbx_builtin_pushvar_helper(), pbx_builtin_setvar_helper(), publish_event_to_corosync(), reload(), remove_shutdown_command(), rtp_address_is_ice_blacklisted(), rtp_codecs_assign_payload_code_rx(), rtp_engine_shutdown(), rtp_reload(), rtp_unload_acl(), send_cluster_notify(), set_active(), set_general_options(), set_next_mime_type(), sip_outbound_publish_client_get_publisher(), stun_address_is_blacklisted(), tps_alert_add(), and translate_shutdown().
#define ast_rwlock_wrlock | ( | a | ) | __ast_rwlock_wrlock(__FILE__, __LINE__, __PRETTY_FUNCTION__, a, #a) |
Definition at line 234 of file lock.h.
Referenced by _ast_hashtab_insert_immediate(), _ast_hashtab_insert_safe(), _ast_hashtab_start_write_traversal(), add_codec2index(), add_static_payload(), ast_adsi_install_funcs(), ast_cli_allow_at_shutdown(), ast_hashtab_destroy(), ast_hashtab_remove_object_via_lookup(), ast_hashtab_remove_this_object(), ast_hashtab_wrlock(), ast_msg_handler_register(), ast_msg_handler_unregister(), ast_msg_tech_register(), ast_msg_tech_unregister(), ast_rtp_codecs_payload_replace_format(), ast_rtp_codecs_payloads_copy(), ast_rtp_codecs_payloads_set_m_type(), ast_rtp_codecs_payloads_set_rtpmap_type_rate(), ast_rtp_codecs_payloads_unset(), ast_rtp_codecs_payloads_xover(), ast_rtp_codecs_set_framing(), ast_rtp_engine_unload_format(), ast_wrlock_context(), cleanup_module(), destroy_pvts(), destroy_table(), get_or_create_subscription(), load_config(), load_general_config(), load_module(), load_tech_calendars(), matrix_resize(), messaging_app_unsubscribe_endpoint(), pbx_builtin_clear_globals(), pbx_builtin_pushvar_helper(), pbx_builtin_setvar_helper(), reload(), remove_shutdown_command(), rtp_codecs_assign_payload_code_rx(), rtp_engine_shutdown(), rtp_reload(), rtp_unload_acl(), set_active(), set_general_options(), set_next_mime_type(), sip_outbound_publish_client_get_publisher(), tps_alert_add(), and translate_shutdown().
#define CHANNEL_DEADLOCK_AVOIDANCE | ( | chan | ) |
Definition at line 352 of file lock.h.
Referenced by ast_hangup(), dahdi_handle_event(), dahdi_read(), mbl_read(), and mbl_write().
#define DEADLOCK_AVOIDANCE | ( | lock | ) |
Definition at line 374 of file lock.h.
Referenced by close_udptl_connection(), configure_local_rtp(), dahdi_lock_sub_owner(), dahdi_master_slave_unlink(), dahdi_queue_frame(), grab_owner(), iax2_destroy(), iax2_key_rotate(), iax2_lock_owner(), mbl_queue_control(), mbl_queue_hangup(), mgcp_queue_frame(), mgcp_queue_hangup(), my_deadlock_avoidance_private(), onAlerting(), onCallCleared(), onCallEstablished(), onModeChanged(), onProgress(), ooh323_destroy(), ooh323_onReceivedDigit(), ooh323_set_read_format(), ooh323_set_write_format(), release_chan(), release_chan_early(), setup_udptl_connection(), socket_process_helper(), and wait_for_peercallno().
#define DLA_LOCK | ( | lock | ) |
Deadlock avoidance lock.
In certain deadlock avoidance scenarios, there is more than one lock to be unlocked and relocked. Therefore, this pair of macros is provided for that purpose. Note that every DLA_UNLOCK MUST be paired with a matching DLA_LOCK. The intent of this pair of macros is to be used around another set of deadlock avoidance code, mainly CHANNEL_DEADLOCK_AVOIDANCE, as the locking order specifies that we may safely lock a channel, followed by its pvt, with no worries about a deadlock. In any other scenario, this macro may not be safe to use.
Definition at line 427 of file lock.h.
Referenced by dahdi_handle_event().
#define DLA_UNLOCK | ( | lock | ) |
Deadlock avoidance unlock.
In certain deadlock avoidance scenarios, there is more than one lock to be unlocked and relocked. Therefore, this pair of macros is provided for that purpose. Note that every DLA_UNLOCK MUST be paired with a matching DLA_LOCK. The intent of this pair of macros is to be used around another set of deadlock avoidance code, mainly CHANNEL_DEADLOCK_AVOIDANCE, as the locking order specifies that we may safely lock a channel, followed by its pvt, with no worries about a deadlock. In any other scenario, this macro may not be safe to use.
Definition at line 408 of file lock.h.
Referenced by dahdi_handle_event().
#define DO_THREAD_CRASH do { } while (0) |
Definition at line 247 of file lock.h.
Referenced by __ast_cond_timedwait(), __ast_cond_wait(), __ast_pthread_mutex_destroy(), __ast_pthread_mutex_init(), __ast_pthread_mutex_lock(), __ast_pthread_mutex_unlock(), __ast_rwlock_destroy(), __ast_rwlock_init(), __ast_rwlock_rdlock(), __ast_rwlock_timedrdlock(), __ast_rwlock_timedwrlock(), __ast_rwlock_unlock(), and __ast_rwlock_wrlock().
#define gethostbyname __gethostbyname__is__not__reentrant__use__ast_gethostbyname__instead__ |
Definition at line 637 of file lock.h.
Referenced by connect_asterisk(), connect_sphinx(), connect_to_host(), main(), and manager_login().
#define pthread_cond_broadcast use_ast_cond_broadcast_instead_of_pthread_cond_broadcast |
Definition at line 631 of file lock.h.
Referenced by __ast_cond_broadcast().
#define pthread_cond_destroy use_ast_cond_destroy_instead_of_pthread_cond_destroy |
Definition at line 629 of file lock.h.
Referenced by __ast_cond_destroy().
#define pthread_cond_init use_ast_cond_init_instead_of_pthread_cond_init |
Definition at line 628 of file lock.h.
Referenced by __ast_cond_init().
#define pthread_cond_signal use_ast_cond_signal_instead_of_pthread_cond_signal |
Definition at line 630 of file lock.h.
Referenced by __ast_cond_signal().
#define pthread_cond_t use_ast_cond_t_instead_of_pthread_cond_t |
#define pthread_cond_timedwait use_ast_cond_timedwait_instead_of_pthread_cond_timedwait |
Definition at line 633 of file lock.h.
Referenced by __ast_cond_timedwait().
#define pthread_cond_wait use_ast_cond_wait_instead_of_pthread_cond_wait |
Definition at line 632 of file lock.h.
Referenced by __ast_cond_wait().
#define pthread_create __use_ast_pthread_create_instead__ |
Definition at line 640 of file lock.h.
Referenced by ast_pthread_create_stack(), main(), misdn_lib_init(), and misdn_tasks_init().
#define pthread_mutex_destroy use_ast_mutex_destroy_instead_of_pthread_mutex_destroy |
Definition at line 627 of file lock.h.
Referenced by __ast_pthread_mutex_destroy(), ast_spinlock_destroy(), delete_reentrancy_cs(), lock_info_destroy(), and stack_destroy().
#define pthread_mutex_init use_ast_mutex_init_instead_of_pthread_mutex_init |
Definition at line 626 of file lock.h.
Referenced by __ast_pthread_mutex_init(), ast_get_reentrancy(), ast_spinlock_init(), dummy_start(), init_bc(), main(), stack_init(), and threadstorage_init().
#define PTHREAD_MUTEX_INIT_VALUE PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP |
#define pthread_mutex_lock use_ast_mutex_lock_instead_of_pthread_mutex_lock |
Definition at line 623 of file lock.h.
Referenced by __ast_bt_destroy(), __ast_pthread_mutex_lock(), ast_dump_locks(), ast_find_lock_info(), ast_get_reentrancy(), ast_log_show_lock(), ast_mark_lock_acquired(), ast_mark_lock_failed(), ast_reentrancy_lock(), ast_remove_lock_info(), ast_restore_lock_info(), ast_spinlock_lock(), ast_store_lock_info(), ast_suspend_lock_info(), dummy_start(), find_free_chan_in_stack(), handle_event_nt(), handle_frm_nt(), handle_l1(), handle_timers(), lock_info_destroy(), main(), manager_event_handler(), misdn_lib_get_free_bc(), misdn_lib_get_l2_down(), misdn_lib_get_l2_up(), misdn_send_lock(), readStdin(), and threadstorage_init().
#define pthread_mutex_t use_ast_mutex_t_instead_of_pthread_mutex_t |
Definition at line 620 of file lock.h.
Referenced by __ast_bt_destroy(), __ast_cond_timedwait(), __ast_cond_wait(), __ast_pthread_mutex_destroy(), __ast_pthread_mutex_init(), __ast_pthread_mutex_unlock(), and threadstorage_init().
#define pthread_mutex_trylock use_ast_mutex_trylock_instead_of_pthread_mutex_trylock |
Definition at line 625 of file lock.h.
Referenced by __ast_pthread_mutex_destroy(), __ast_pthread_mutex_lock(), __ast_pthread_mutex_trylock(), and ast_spinlock_trylock().
#define pthread_mutex_unlock use_ast_mutex_unlock_instead_of_pthread_mutex_unlock |
Definition at line 624 of file lock.h.
Referenced by __ast_bt_destroy(), __ast_pthread_mutex_destroy(), __ast_pthread_mutex_unlock(), ast_dump_locks(), ast_find_lock_info(), ast_get_reentrancy(), ast_log_show_lock(), ast_mark_lock_acquired(), ast_mark_lock_failed(), ast_reentrancy_unlock(), ast_remove_lock_info(), ast_restore_lock_info(), ast_spinlock_unlock(), ast_store_lock_info(), ast_suspend_lock_info(), dummy_start(), find_free_chan_in_stack(), handle_event_nt(), handle_frm_nt(), handle_l1(), handle_timers(), lock_info_destroy(), main(), manager_event_handler(), misdn_lib_get_free_bc(), misdn_lib_get_l2_down(), misdn_lib_get_l2_up(), misdn_send_unlock(), readStdin(), and threadstorage_init().
#define ROFFSET ((lt->reentrancy > 0) ? (lt->reentrancy-1) : 0) |
Definition at line 240 of file lock.h.
Referenced by __ast_cond_timedwait(), __ast_cond_wait(), __ast_pthread_mutex_destroy(), __ast_pthread_mutex_lock(), and __ast_pthread_mutex_unlock().
#define SCOPED_AO2LOCK | ( | varname, | |
obj | |||
) | SCOPED_LOCK(varname, (obj), ao2_lock, ao2_unlock) |
scoped lock specialization for ao2 mutexes.
Definition at line 602 of file lock.h.
Referenced by apply_menu_to_user(), ast_cdr_fork(), ast_endpoint_snapshot_create(), ast_media_cache_create_or_update(), ast_media_cache_retrieve(), ast_sip_publish_client_send(), ast_sip_session_register_sdp_handler(), ast_taskprocessor_set_local(), ast_threadpool_push(), ast_threadpool_set_size(), ast_unreal_channel_push_to_bridge(), cancel_and_unpublish(), clear_stimulus_queue(), cli_show_channels(), complete_confbridge_participant(), consumer_exec(), consumer_exec_sync(), consumer_should_stay(), consumer_wait_for(), consumer_wait_for_completion(), event_session_shutdown(), find_route(), generic_mute_unmute_helper(), get_wait_bridge_wrapper(), handle_bridge_enter(), handle_local_optimization_begin(), handle_local_optimization_end(), kick_conference_participant(), one_protocol(), persistent_endpoint_find_or_create(), playback_cancel(), playback_final_update(), playback_first_update(), playback_forward(), playback_pause(), playback_restart(), playback_reverse(), playback_stop(), playback_unpause(), publisher_client_send(), recording_set_state(), remove_stasis_subscriptions(), sip_outbound_publish_callback(), sip_publisher_service_queue(), stasis_app_control_record(), stasis_app_playback_get_state(), stasis_app_playback_operation(), stasis_app_recording_operation(), stasis_topic_pool_get_topic(), threadpool_active_thread_idle(), threadpool_idle_thread_dead(), threadpool_tps_emptied(), threadpool_tps_task_pushed(), and threadpool_zombie_thread_dead().
#define SCOPED_AO2RDLOCK | ( | varname, | |
obj | |||
) | SCOPED_LOCK(varname, (obj), ao2_rdlock, ao2_unlock) |
scoped lock specialization for ao2 read locks.
Definition at line 607 of file lock.h.
Referenced by bucket_file_wizard_retrieve(), and bucket_wizard_retrieve().
#define SCOPED_AO2WRLOCK | ( | varname, | |
obj | |||
) | SCOPED_LOCK(varname, (obj), ao2_wrlock, ao2_unlock) |
scoped lock specialization for ao2 write locks.
Definition at line 612 of file lock.h.
Referenced by __ast_bucket_scheme_register(), __ast_codec_register_with_format(), __ast_format_interface_register(), and ast_format_cache_set().
#define SCOPED_CHANNELLOCK | ( | varname, | |
chan | |||
) | SCOPED_LOCK(varname, (chan), ast_channel_lock, ast_channel_unlock) |
scoped lock specialization for channels.
Definition at line 617 of file lock.h.
Referenced by add_masquerade_store(), add_transferer_role(), after_bridge_cb_find(), after_bridge_cb_setup(), ast_bridge_read_after_goto(), AST_TEST_DEFINE(), ast_unreal_channel_push_to_bridge(), builtin_feature_get_exten(), conf_announce_channel_push(), dtmfstore_exec(), get_park_common_datastore_copy(), has_masquerade_store(), internal_feature_read(), internal_feature_write(), internal_featuremap_read(), internal_featuremap_write(), remove_detect(), remove_dtmf_store(), remove_hold_intercept(), remove_masquerade_store(), remove_scrambler(), remove_talk_detect(), report_fax_status(), report_receive_fax_status(), report_send_fax_status(), set_hold_intercept(), set_talk_detect(), set_touch_variables(), and snoop_determine_format().
#define SCOPED_LOCK | ( | varname, | |
lock, | |||
lockfunc, | |||
unlockfunc | |||
) | RAII_VAR(typeof((lock)), varname, ({lockfunc((lock)); (lock); }), unlockfunc) |
Scoped Locks.
Scoped locks provide a way to use RAII locks. In other words, declaration of a scoped lock will automatically define and lock the lock. When the lock goes out of scope, it will automatically be unlocked.
In the above example, neither return path requires explicit unlocking of the channel.
varname | The unique name to give to the scoped lock. You are not likely to reference this outside of the SCOPED_LOCK invocation. |
lock | The variable to lock. This can be anything that can be passed to a locking or unlocking function. |
lockfunc | The function to call to lock the lock |
unlockfunc | The function to call to unlock the lock |
Definition at line 581 of file lock.h.
Referenced by add_headers_to_message(), ast_bridge_basic_set_flags(), ast_bridge_transfer_attended(), ast_bridge_transfer_blind(), ast_sip_format_endpoint_ami(), ast_sip_identify_endpoint(), ast_sip_register_endpoint_formatter(), ast_sip_register_endpoint_identifier_with_name(), ast_sip_register_event_publisher_handler(), ast_sip_register_supplement(), ast_sip_session_add_supplements(), ast_sip_session_register_supplement_with_module(), ast_sip_session_unregister_supplement(), ast_sip_unregister_endpoint_formatter(), ast_sip_unregister_endpoint_identifier(), ast_sip_unregister_event_publisher_handler(), ast_sip_unregister_supplement(), AST_TEST_DEFINE(), bridge_basic_change_personality(), channel_get_external_vars(), cli_show_endpoint_identifiers(), get_sip_pvt_from_replaces(), handle_request_invite(), and remove_hooks_on_personality_change().
#define SCOPED_MUTEX | ( | varname, | |
lock | |||
) | SCOPED_LOCK(varname, (lock), ast_mutex_lock, ast_mutex_unlock) |
scoped lock specialization for mutexes
Definition at line 587 of file lock.h.
Referenced by ast_ari_add_handler(), ast_channel_move(), ast_config_engine_deregister(), ast_config_engine_register(), ast_crypt_validate(), ast_realtime_is_mapping_defined(), complex_task(), find_engine(), get_root_handler(), get_wrapper(), handle_cli_core_show_config_mappings(), has_complex_started(), load_module(), load_task(), message_sink_cb(), mid_test_sync(), poke_worker(), prometheus_callback_register(), prometheus_callback_unregister(), prometheus_last_scrape_time_get(), prometheus_metric_register(), prometheus_metric_registered_count(), prometheus_metric_unregister(), registration_deleted_observer(), registration_loaded_observer(), reload_module(), shutdown_has_completed(), shutdown_poke(), shutdown_task_exec(), shutdown_waitfor_completion(), shutdown_waitfor_start(), simple_task(), sorcery_observer_created(), sorcery_observer_deleted(), sorcery_observer_loaded(), sorcery_observer_updated(), stasis_message_sink_dtor(), stasis_message_sink_should_stay(), stasis_message_sink_wait_for(), stasis_message_sink_wait_for_count(), task(), task_wait(), test_emptied(), test_state_changed(), test_sub(), test_task_pushed(), unload_module(), wait_for_completion(), wait_for_complex_completion(), wait_for_complex_start(), wait_for_empty_notice(), wait_for_stimulus(), wait_for_task_pushed(), wait_until_thread_state(), and worker_set_state().
#define SCOPED_RDLOCK | ( | varname, | |
lock | |||
) | SCOPED_LOCK(varname, (lock), ast_rwlock_rdlock, ast_rwlock_unlock) |
scoped lock specialization for read locks
Definition at line 592 of file lock.h.
Referenced by ast_get_extension_for_mime_type(), ast_get_format_for_file_ext(), ast_start_mixmonitor(), and ast_stop_mixmonitor().
#define SCOPED_WRLOCK | ( | varname, | |
lock | |||
) | SCOPED_LOCK(varname, (lock), ast_rwlock_wrlock, ast_rwlock_unlock) |
scoped lock specialization for write locks
Definition at line 597 of file lock.h.
Referenced by ast_clear_mixmonitor_methods(), ast_set_mixmonitor_methods(), ast_sip_publish_client_remove(), and get_publishes_and_update_state().
typedef pthread_cond_t ast_cond_t |
typedef struct ast_mutex_info ast_mutex_t |
typedef struct ast_rwlock_info ast_rwlock_t |
enum ast_lock_type |
Enumerator | |
---|---|
AST_MUTEX | |
AST_RDLOCK | |
AST_WRLOCK |
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 | lineno, | ||
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 | lineno, | ||
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 | lineno, | ||
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 | lineno, | ||
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 | lineno, | ||
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 | lineno, | ||
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 | lineno, | ||
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().
|
inline |
decrement *p by 1 and return true if the variable has reached 0.
Useful e.g. to check if a refcount has reached 0.
Definition at line 765 of file lock.h.
Referenced by dispose_conf(), iax2_process_thread_cleanup(), run_station(), and sla_station_exec().
|
inline |
Atomically add v to *p and return the previous value of *p.
This can be used to handle reference counts, and the return value can be used to generate unique identifiers.
Definition at line 755 of file lock.h.
References ast_atomic_sub_fetch.
Referenced by __ao2_link(), __ao2_lock(), __ao2_ref(), __ao2_trylock(), __ao2_unlock(), __ast_channel_alloc_ap(), __ast_channel_internal_alloc(), __ast_module_ref(), __ast_module_unref(), __ast_module_user_add(), __ast_module_user_hangup_all(), __ast_module_user_remove(), __container_unlink_node_debug(), __manager_event_sessions_va(), _sip_tcp_helper_thread(), accept_thread(), acf_odbc_read(), action_login(), admin_exec(), advance_event(), ao2_container_count(), append_event(), ast_bridge_interval_hook(), ast_channel_destructor(), ast_channel_internal_setup_topics(), ast_cli_command_full(), ast_create_callid(), ast_odbc_execute_sql(), ast_odbc_prepare(), ast_odbc_prepare_and_execute(), ast_odbc_smart_execute(), ast_sip_schedule_task(), ast_taskprocessor_seq_num(), AST_TEST_DEFINE(), ast_undestroyed_channels(), ast_unreal_new_channels(), authenticate_verify(), bridge_channel_handle_interval(), bridge_channel_queue_action_data_sync(), build_conf(), build_peer(), cc_device_monitor_init(), cc_extension_monitor_init(), cc_interfaces_datastore_init(), cdr_object_alloc(), chan_pjsip_new(), container_destruct(), create_new_sip_etag(), dahdi_destroy(), dahdi_request(), dahdi_translate(), destroy_session(), dial_append_common(), dispatch_message(), dns_query_set_callback(), dundi_query_read(), enum_query_read(), fax_session_new(), fax_session_release(), fax_session_reserve(), find_idle_thread(), find_load_queue_rt_friendly(), find_session(), find_transcoders(), generate_msg_id(), generic_fax_exec(), grab_last(), handle_message(), hash_ao2_container_init(), hash_test_grow(), hash_test_lookup(), hook_read(), ht_delete(), ht_new(), httpd_helper_thread(), iax2_destroy_helper(), iax2_process_thread(), iax_frame_free(), iax_frame_new(), inprocess_count(), internal_ao2_alloc(), internal_stasis_subscribe(), pjsip_history_entry_alloc(), publish_msg(), pubsub_on_rx_publish_request(), rb_ao2_container_init(), rec_request(), receivefax_exec(), reload_single_queue(), run_station(), sendfax_exec(), session_destructor(), session_do(), sip_create_publication(), sip_destroy_peer(), sip_new(), sip_peer_hold(), sla_add_trunk_to_station(), sla_handle_hold_event(), sla_station_exec(), smdi_msg_retrieve_read(), spandsp_fax_switch_to_t38(), stasis_app_control_snoop(), stasis_caching_topic_create(), stasis_cp_all_create(), stasis_message_type_create(), temp_peer(), transport_create(), try_merge_optimize_out(), try_swap_optimize_out(), update_stats(), and worker_thread_alloc().
struct ast_str* ast_dump_locks | ( | void | ) |
Generate a lock dump equivalent to "core show locks".
The lock dump generated is generally too large to be output by a single ast_verbose/log/debug/etc. call. Only ast_cli() handles it properly without changing BUFSIZ in logger.c.
Note: This must be ast_free()d when you're done with it.
An | ast_str containing the lock dump |
NULL | on error |
Definition at line 1264 of file main/utils.c.
References append_lock_information(), ast_get_version(), AST_LIST_TRAVERSE, ast_str_append(), ast_str_create, thr_lock_info::lock, lock_info, lock_infos_lock, thr_lock_info::locks, thr_lock_info::lwp, ast_mutex_info::mutex, NULL, thr_lock_info::num_locks, pthread_mutex_lock, pthread_mutex_unlock, str, thr_lock_info::suspended, thr_lock_info::thread_id, and thr_lock_info::thread_name.
Referenced by handle_show_locks().
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
this gets called during deadlock avoidance, so that the information may be preserved as to what location originally acquired the lock.
Definition at line 995 of file main/utils.c.
References ast_copy_string(), ast_threadstorage_get(), thr_lock_info::file, thr_lock_info::func, thr_lock_info::line_num, thr_lock_info::lock, thr_lock_info::lock_addr, lock_info, thr_lock_info::lock_name, thr_lock_info::locks, thr_lock_info::num_locks, pthread_mutex_lock, pthread_mutex_unlock, and thread_lock_info.
void ast_log_show_lock | ( | void * | this_lock_addr | ) |
log info for the current lock with ast_log().
this function would be mostly for debug. If you come across a lock that is unexpectedly but momentarily locked, and you wonder who are fighting with for the lock, this routine could be called, IF you have the thread debugging stuff turned on.
this_lock_addr | lock address to return lock information |
This function can help you find highly temporal locks; locks that happen for a short time, but at unexpected times, usually at times that create a deadlock, Why is this thing locked right then? Who is locking it? Who am I fighting with for this lock?
To answer such questions, just call this routine before you would normally try to aquire a lock. It doesn't do anything if the lock is not acquired. If the lock is taken, it will publish a line or two to the console via ast_log().
Sometimes, the lock message is pretty uninformative. For instance, you might find that the lock is being aquired deep within the astobj2 code; this tells you little about higher level routines that call the astobj2 routines. But, using gdb, you can set a break at the ast_log below, and for that breakpoint, you can set the commands: where cont which will give a stack trace and continue. – that aught to do the job!
Definition at line 1231 of file main/utils.c.
References append_lock_information(), ast_free, AST_LIST_TRAVERSE, ast_log, ast_str_buffer(), ast_str_create, thr_lock_info::lock, thr_lock_info::lock_addr, lock_info, lock_infos_lock, thr_lock_info::locks, LOG_NOTICE, ast_mutex_info::mutex, thr_lock_info::num_locks, pthread_mutex_lock, pthread_mutex_unlock, and str.
void ast_mark_lock_acquired | ( | void * | lock_addr | ) |
Mark the last lock as acquired.
Definition at line 94 of file check_expr.c.
References ast_threadstorage_get(), thr_lock_info::lock, thr_lock_info::lock_addr, lock_info, thr_lock_info::locks, thr_lock_info::num_locks, thr_lock_info::pending, pthread_mutex_lock, pthread_mutex_unlock, and thread_lock_info.
Referenced by __ast_pthread_mutex_lock(), __ast_pthread_mutex_trylock(), __ast_rwlock_rdlock(), __ast_rwlock_timedrdlock(), __ast_rwlock_timedwrlock(), __ast_rwlock_tryrdlock(), __ast_rwlock_trywrlock(), __ast_rwlock_wrlock(), and ast_restore_lock_info().
void ast_mark_lock_failed | ( | void * | lock_addr | ) |
Mark the last lock as failed (trylock)
Definition at line 2314 of file extconf.c.
References ast_threadstorage_get(), thr_lock_info::lock, thr_lock_info::lock_addr, lock_info, thr_lock_info::locks, thr_lock_info::num_locks, thr_lock_info::pending, pthread_mutex_lock, pthread_mutex_unlock, thread_lock_info, and thr_lock_info::times_locked.
Referenced by __ast_pthread_mutex_trylock(), __ast_rwlock_tryrdlock(), __ast_rwlock_trywrlock(), and ast_tvsub().
|
inlinestatic |
Definition at line 443 of file lock.h.
References pthread_mutex_lock, and ast_lock_track::reentr_mutex.
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(), __ast_rwlock_wrlock(), append_lock_information(), and restore_lock_tracking().
|
inlinestatic |
Definition at line 454 of file lock.h.
References pthread_mutex_unlock, and ast_lock_track::reentr_mutex.
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(), __ast_rwlock_wrlock(), append_lock_information(), and restore_lock_tracking().
void ast_remove_lock_info | ( | void * | lock_addr, |
struct ast_bt * | bt | ||
) |
remove lock info for the current thread
this gets called by ast_mutex_unlock so that information on the lock can be removed from the current thread's lock info struct.
Definition at line 68 of file check_expr.c.
References __ast_bt_get_addresses(), ast_threadstorage_get(), thr_lock_info::backtrace, thr_lock_info::lock, thr_lock_info::lock_addr, lock_info, thr_lock_info::locks, thr_lock_info::num_locks, pthread_mutex_lock, pthread_mutex_unlock, thread_lock_info, and thr_lock_info::times_locked.
Referenced by __ast_pthread_mutex_lock(), __ast_pthread_mutex_unlock(), __ast_rwlock_rdlock(), __ast_rwlock_timedrdlock(), __ast_rwlock_timedwrlock(), __ast_rwlock_unlock(), __ast_rwlock_wrlock(), and ast_store_lock_info().
void ast_restore_lock_info | ( | void * | lock_addr | ) |
Definition at line 1059 of file main/utils.c.
References ast_mark_lock_acquired(), ast_threadstorage_get(), thr_lock_info::lock, thr_lock_info::lock_addr, lock_info, thr_lock_info::locks, thr_lock_info::num_locks, pthread_mutex_lock, pthread_mutex_unlock, thr_lock_info::suspended, and thread_lock_info.
Referenced by __ast_cond_timedwait(), and __ast_cond_wait().
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.
This function gets called in ast_mutex_lock() and ast_mutex_trylock() so that information about this lock can be stored in this thread's lock info struct. The lock is marked as pending as the thread is waiting on the lock. ast_mark_lock_acquired() will mark it as held by this thread.
Definition at line 61 of file check_expr.c.
References AST_MAX_LOCKS, ast_remove_lock_info(), ast_threadstorage_get(), thr_lock_info::backtrace, thr_lock_info::file, thr_lock_info::func, thr_lock_info::line_num, thr_lock_info::lock, thr_lock_info::lock_addr, lock_info, thr_lock_info::lock_name, thr_lock_info::locks, thr_lock_info::num_locks, thr_lock_info::pending, pthread_mutex_lock, pthread_mutex_unlock, thread_lock_info, thr_lock_info::times_locked, and thr_lock_info::type.
Referenced by __ast_pthread_mutex_lock(), __ast_pthread_mutex_trylock(), __ast_rwlock_rdlock(), __ast_rwlock_timedrdlock(), __ast_rwlock_timedwrlock(), __ast_rwlock_tryrdlock(), __ast_rwlock_trywrlock(), and __ast_rwlock_wrlock().
void ast_suspend_lock_info | ( | void * | lock_addr | ) |
Definition at line 1030 of file main/utils.c.
References ast_threadstorage_get(), thr_lock_info::lock, thr_lock_info::lock_addr, lock_info, thr_lock_info::locks, thr_lock_info::num_locks, pthread_mutex_lock, pthread_mutex_unlock, thr_lock_info::suspended, and thread_lock_info.
Referenced by __ast_cond_timedwait(), and __ast_cond_wait().