Codename Pineapple

Home page | Mailing list | Docs

Last updated: Sat Feb 3 05:01:35 2007

Asterisk developer's documentation :: Codename Pineapple


lock.h File Reference


Detailed Description

General Asterisk channel locking definitions.

Definition in file lock.h.

#include <pthread.h>
#include <netdb.h>
#include <time.h>
#include <sys/param.h>
#include "asterisk/logger.h"
#include "asterisk/inline_api.h"

Include dependency graph for lock.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define __AST_MUTEX_DEFINE(scope, mutex)   scope ast_mutex_t mutex = AST_MUTEX_INIT_VALUE
#define __AST_RWLOCK_DEFINE(scope, rwlock)
#define __MTX_PROF(a)   return pthread_mutex_lock((a))
#define ast_channel_lock(x)   ast_mutex_lock(&x->lock)
#define ast_channel_trylock(x)   ast_mutex_trylock(&x->lock)
#define ast_channel_unlock(x)   ast_mutex_unlock(&x->lock)
#define AST_MUTEX_DEFINE_STATIC(mutex)   __AST_MUTEX_DEFINE(static, mutex)
#define AST_MUTEX_INIT_VALUE   ((ast_mutex_t) PTHREAD_MUTEX_INIT_VALUE)
#define AST_MUTEX_INITIALIZER   __use_AST_MUTEX_DEFINE_STATIC_rather_than_AST_MUTEX_INITIALIZER__
#define AST_MUTEX_KIND   PTHREAD_MUTEX_RECURSIVE
#define ast_pthread_mutex_init(pmutex, a)   pthread_mutex_init(pmutex,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)
#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_MUTEX_INITIALIZER
#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

Typedefs

typedef pthread_cond_t ast_cond_t
typedef pthread_mutex_t ast_mutex_t
typedef pthread_rwlock_t ast_rwlock_t

Functions

int ast_atomic_fetchadd_int_slow (volatile int *p, int v)
static int ast_cond_broadcast (ast_cond_t *cond)
static int ast_cond_destroy (ast_cond_t *cond)
static int ast_cond_init (ast_cond_t *cond, pthread_condattr_t *cond_attr)
static int ast_cond_signal (ast_cond_t *cond)
static int ast_cond_timedwait (ast_cond_t *cond, ast_mutex_t *t, const struct timespec *abstime)
static int ast_cond_wait (ast_cond_t *cond, ast_mutex_t *t)
 AST_INLINE_API (int ast_atomic_fetchadd_int(volatile int *p, int v),{return ast_atomic_fetchadd_int_slow(p, v);}) AST_INLINE_API(int ast_atomic_dec_and_test(volatile int *p)
 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. decrement *p by 1 and return true if the variable has reached 0. Useful e.g. to check if a refcount has reached 0.
static int ast_mutex_destroy (ast_mutex_t *pmutex)
static int ast_mutex_init (ast_mutex_t *pmutex)
static int ast_mutex_lock (ast_mutex_t *pmutex)
static int ast_mutex_trylock (ast_mutex_t *pmutex)
static int ast_mutex_unlock (ast_mutex_t *pmutex)
static int ast_rwlock_destroy (ast_rwlock_t *prwlock)
static int ast_rwlock_init (ast_rwlock_t *prwlock)
static int ast_rwlock_rdlock (ast_rwlock_t *prwlock)
static int ast_rwlock_tryrdlock (ast_rwlock_t *prwlock)
static int ast_rwlock_trywrlock (ast_rwlock_t *prwlock)
static int ast_rwlock_unlock (ast_rwlock_t *prwlock)
static int ast_rwlock_wrlock (ast_rwlock_t *prwlock)


Define Documentation

#define __AST_MUTEX_DEFINE scope,
mutex   )     scope ast_mutex_t mutex = AST_MUTEX_INIT_VALUE
 

Definition at line 592 of file lock.h.

#define __AST_RWLOCK_DEFINE scope,
rwlock   ) 
 

Definition at line 668 of file lock.h.

#define __MTX_PROF  )     return pthread_mutex_lock((a))
 

Definition at line 59 of file lock.h.

Referenced by ast_mutex_lock().

#define ast_channel_lock  )     ast_mutex_lock(&x->lock)
 

Referenced by __ast_answer(), __ast_read(), __oh323_destroy(), __sip_destroy(), agent_hangup(), ast_activate_generator(), ast_async_goto(), ast_call(), ast_channel_free(), ast_channel_masquerade(), ast_check_hangup_locked(), ast_deactivate_generator(), ast_do_masquerade(), ast_hangup(), ast_indicate_data(), ast_pbx_outgoing_app(), ast_pbx_outgoing_exten(), ast_queue_frame(), ast_rtp_bridge(), ast_rtp_early_bridge(), ast_rtp_make_compatible(), ast_softhangup(), ast_transfer(), ast_udptl_bridge(), ast_waitfor_nandfds(), ast_write(), func_header_read(), function_sipchaninfo_read(), handle_request_invite(), p2p_callback_disable(), set_format(), sip_addheader(), sip_dtmfmode(), sip_park(), and sip_park_thread().

#define ast_channel_trylock  )     ast_mutex_trylock(&x->lock)
 

Referenced by __oh323_rtp_create(), ast_channel_masquerade(), ast_queue_hangup(), ast_rtp_bridge(), ast_rtp_early_bridge(), ast_rtp_make_compatible(), ast_udptl_bridge(), auto_congest(), channel_find_locked(), check_rtp_timeout(), cleanup_connection(), hangup_connection(), oh323_rtp_read(), oh323_simulate_dtmf_end(), process_sip_queue(), receive_digit(), remote_hold(), retrans_pkt(), setup_rtp_connection(), sipsock_read(), and update_state().

#define ast_channel_unlock  )     ast_mutex_unlock(&x->lock)
 

Referenced by __ast_answer(), __ast_read(), __oh323_destroy(), __oh323_rtp_create(), __sip_destroy(), action_getvar(), action_hangup(), action_redirect(), action_setvar(), action_status(), action_timeout(), agent_hangup(), ast_activate_generator(), ast_app_group_get_count(), ast_app_group_match_get_count(), ast_async_goto(), ast_async_goto_by_name(), ast_call(), ast_channel_free(), ast_channel_masquerade(), ast_check_hangup_locked(), ast_complete_channels(), ast_deactivate_generator(), ast_hangup(), ast_indicate_data(), ast_parse_device_state(), ast_pbx_outgoing_app(), ast_pbx_outgoing_exten(), ast_pickup_call(), ast_queue_frame(), ast_queue_hangup(), ast_rtp_bridge(), ast_rtp_early_bridge(), ast_rtp_make_compatible(), ast_softhangup(), ast_transfer(), ast_udptl_bridge(), ast_waitfor_nandfds(), ast_write(), auto_congest(), bridge_native_loop(), bridge_p2p_loop(), change_monitor_action(), check_rtp_timeout(), cleanup_connection(), do_pause_or_unpause(), fast_originate(), func_header_read(), function_sipchaninfo_read(), group_show_channels(), handle_chanlist(), handle_channelstatus(), handle_core_set_debug_channel(), handle_getvariablefull(), handle_hangup(), handle_invite_replaces(), handle_request_invite(), handle_request_refer(), handle_showchan(), handle_softhangup(), hangup_connection(), local_attended_transfer(), manager_park(), moh_on_off(), oh323_rtp_read(), oh323_simulate_dtmf_end(), p2p_callback_disable(), pbx_builtin_importvar(), process_sip_queue(), receive_digit(), remote_hold(), retrans_pkt(), set_format(), setup_rtp_connection(), sip_addheader(), sip_dtmfmode(), sip_park(), sip_park_thread(), start_monitor_action(), stop_monitor_action(), and update_state().

#define AST_MUTEX_DEFINE_STATIC mutex   )     __AST_MUTEX_DEFINE(static, mutex)
 

Definition at line 610 of file lock.h.

#define AST_MUTEX_INIT_VALUE   ((ast_mutex_t) PTHREAD_MUTEX_INIT_VALUE)
 

Definition at line 509 of file lock.h.

#define AST_MUTEX_INITIALIZER   __use_AST_MUTEX_DEFINE_STATIC_rather_than_AST_MUTEX_INITIALIZER__
 

Definition at line 612 of file lock.h.

#define AST_MUTEX_KIND   PTHREAD_MUTEX_RECURSIVE
 

Definition at line 88 of file lock.h.

Referenced by ast_mutex_init().

#define ast_pthread_mutex_init pmutex,
 )     pthread_mutex_init(pmutex,a)
 

Definition at line 521 of file lock.h.

#define AST_PTHREADT_NULL   (pthread_t) -1
 

Definition at line 74 of file lock.h.

Referenced by __ast_device_state_changed_literal(), __manager_event(), __unload_module(), action_waitevent(), ast_autoservice_start(), ast_autoservice_stop(), ast_cdr_submit_batch(), ast_dial_create(), ast_dial_join(), ast_log(), ast_smdi_interface_destroy(), ast_verbose(), console_verboser(), do_reload(), load_module(), reload(), restart_monitor(), server_start(), session_do(), and unload_module().

#define AST_PTHREADT_STOP   (pthread_t) -2
 

Definition at line 75 of file lock.h.

Referenced by __unload_module(), ast_dial_join(), ast_smdi_interface_destroy(), kill_monitor(), monitor_dial(), restart_monitor(), and unload_module().

#define AST_RWLOCK_DEFINE_STATIC rwlock   )     __AST_RWLOCK_DEFINE(static, rwlock)
 

Definition at line 684 of file lock.h.

#define gethostbyname   __gethostbyname__is__not__reentrant__use__ast_gethostbyname__instead__
 

Definition at line 614 of file lock.h.

Referenced by connect_sphinx(), and gethostbyname_r().

#define pthread_cond_broadcast   use_ast_cond_broadcast_instead_of_pthread_cond_broadcast
 

Definition at line 606 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 604 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 603 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 605 of file lock.h.

Referenced by ast_cond_signal().

#define pthread_cond_t   use_ast_cond_t_instead_of_pthread_cond_t
 

Definition at line 602 of file lock.h.

#define pthread_cond_timedwait   use_ast_cond_timedwait_instead_of_pthread_cond_timedwait
 

Definition at line 608 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 607 of file lock.h.

Referenced by ast_cond_wait().

#define pthread_create   __use_ast_pthread_create_instead__
 

Definition at line 617 of file lock.h.

Referenced by ast_pthread_create_stack(), and misdn_tasks_init().

#define pthread_mutex_destroy   use_ast_mutex_destroy_instead_of_pthread_mutex_destroy
 

Definition at line 601 of file lock.h.

Referenced by ast_mutex_destroy(), and dlcompat_cleanup().

#define pthread_mutex_init   use_ast_mutex_init_instead_of_pthread_mutex_init
 

Definition at line 600 of file lock.h.

Referenced by ast_mutex_init(), and dlcompat_init_func().

#define PTHREAD_MUTEX_INIT_VALUE   PTHREAD_MUTEX_INITIALIZER
 

Definition at line 87 of file lock.h.

#define pthread_mutex_lock   use_ast_mutex_lock_instead_of_pthread_mutex_lock
 

Definition at line 597 of file lock.h.

Referenced by dolock().

#define pthread_mutex_t   use_ast_mutex_t_instead_of_pthread_mutex_t
 

Definition at line 596 of file lock.h.

#define pthread_mutex_trylock   use_ast_mutex_trylock_instead_of_pthread_mutex_trylock
 

Definition at line 599 of file lock.h.

Referenced by ast_mutex_trylock().

#define pthread_mutex_unlock   use_ast_mutex_unlock_instead_of_pthread_mutex_unlock
 

Definition at line 598 of file lock.h.

Referenced by ast_mutex_unlock(), and dounlock().


Typedef Documentation

typedef pthread_cond_t ast_cond_t
 

Definition at line 543 of file lock.h.

typedef pthread_mutex_t ast_mutex_t
 

Definition at line 507 of file lock.h.

typedef pthread_rwlock_t ast_rwlock_t
 

Definition at line 620 of file lock.h.


Function Documentation

int ast_atomic_fetchadd_int_slow volatile int *  p,
int  v
 

Definition at line 939 of file utils.c.

References ast_mutex_lock(), and ast_mutex_unlock().

00940 {
00941         int ret;
00942         ast_mutex_lock(&fetchadd_m);
00943         ret = *p;
00944         *p += v;
00945         ast_mutex_unlock(&fetchadd_m);
00946         return ret;
00947 }

static int ast_cond_broadcast ast_cond_t cond  )  [inline, static]
 

Definition at line 555 of file lock.h.

References pthread_cond_broadcast.

00556 {
00557    return pthread_cond_broadcast(cond);
00558 }

static int ast_cond_destroy ast_cond_t cond  )  [inline, static]
 

Definition at line 560 of file lock.h.

References pthread_cond_destroy.

Referenced by ast_channel_spy_free(), do_reload(), find_idle_thread(), init_logger(), and thread_free().

00561 {
00562    return pthread_cond_destroy(cond);
00563 }

static int ast_cond_init ast_cond_t cond,
pthread_condattr_t *  cond_attr
[inline, static]
 

Definition at line 545 of file lock.h.

References pthread_cond_init.

Referenced by ast_channel_spy_add(), ast_device_state_engine_init(), do_reload(), find_idle_thread(), init_logger(), load_module(), and start_network_thread().

00546 {
00547    return pthread_cond_init(cond, cond_attr);
00548 }

static int ast_cond_signal ast_cond_t cond  )  [inline, static]
 

Definition at line 550 of file lock.h.

References pthread_cond_signal.

Referenced by __ast_device_state_changed_literal(), __unload_module(), ast_log(), ast_verbose(), close_logger(), queue_frame_to_spies(), signal_condition(), spy_detach(), and submit_unscheduled_batch().

00551 {
00552    return pthread_cond_signal(cond);
00553 }

static int ast_cond_timedwait ast_cond_t cond,
ast_mutex_t t,
const struct timespec *  abstime
[inline, static]
 

Definition at line 570 of file lock.h.

References pthread_cond_timedwait.

Referenced by ast_channel_spy_trigger_wait(), do_cdr(), iax2_process_thread(), and sched_thread().

00571 {
00572    return pthread_cond_timedwait(cond, t, abstime);
00573 }

static int ast_cond_wait ast_cond_t cond,
ast_mutex_t t
[inline, static]
 

Definition at line 565 of file lock.h.

References pthread_cond_wait.

Referenced by do_devstate_changes(), and logger_thread().

00566 {
00567    return pthread_cond_wait(cond, t);
00568 }

AST_INLINE_API int   ast_atomic_fetchadd_int(volatile int *p, int v)  )  volatile
 

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. decrement *p by 1 and return true if the variable has reached 0. Useful e.g. to check if a refcount has reached 0.

static int ast_mutex_destroy ast_mutex_t pmutex  )  [inline, static]
 

Definition at line 528 of file lock.h.

References pthread_mutex_destroy.

Referenced by __login_exec(), __oh323_destroy(), agent_cleanup(), agent_hangup(), ast_channel_free(), ast_channel_spy_free(), ast_channel_whisper_stop(), ast_dnsmgr_release(), ast_odbc_request_obj(), ast_rtp_destroy(), ast_speech_destroy(), ast_speech_new(), build_gateway(), delete_devices(), destroy_session(), destroy_zt_pvt(), features_hangup(), find_idle_thread(), free_session(), local_alloc(), local_hangup(), local_queue_frame(), misdn_cfg_destroy(), misdn_jb_destroy(), read_agent_config(), release_chan(), sched_context_destroy(), sip_alloc(), thread_free(), timing_read(), and unload_module().

00529 {
00530    return pthread_mutex_destroy(pmutex);
00531 }

static int ast_mutex_init ast_mutex_t pmutex  )  [inline, static]
 

Definition at line 511 of file lock.h.

References AST_MUTEX_KIND, and pthread_mutex_init.

Referenced by accept_thread(), add_agent(), ast_channel_whisper_start(), ast_dnsmgr_get(), ast_odbc_request_obj(), ast_rtp_new_init(), ast_speech_new(), build_device(), build_gateway(), chandup(), features_alloc(), find_idle_thread(), find_tpeer(), gtalk_alloc(), jingle_alloc(), load_module(), local_alloc(), misdn_cfg_init(), misdn_jb_init(), mkintf(), oh323_alloc(), read_config(), sched_context_create(), session_do(), sip_alloc(), sipnet_lock_init(), skinny_new(), and start_network_thread().

00512 {
00513    pthread_mutexattr_t attr;
00514 
00515    pthread_mutexattr_init(&attr);
00516    pthread_mutexattr_settype(&attr, AST_MUTEX_KIND);
00517 
00518    return pthread_mutex_init(pmutex, &attr);
00519 }

static int ast_mutex_lock ast_mutex_t pmutex  )  [inline, static]
 

Definition at line 533 of file lock.h.

References __MTX_PROF.

Referenced by __ast_context_create(), __ast_context_destroy(), __ast_key_get(), __attempt_transmit(), __auth_reject(), __auto_congest(), __auto_hangup(), __get_from_jb(), __iax2_poke_noanswer(), __login_exec(), __manager_event(), __oh323_new(), __send_lagrq(), __send_ping(), __unload_module(), accept_thread(), action_agents(), action_challenge(), action_waitevent(), action_zapshowchannels(), agent_ack_sleep(), agent_call(), agent_cont_sleep(), agent_devicestate(), agent_digit_begin(), agent_digit_end(), agent_fixup(), agent_hangup(), agent_indicate(), agent_new(), agent_read(), agent_request(), agent_sendhtml(), agent_sendtext(), agent_write(), agents_show(), agents_show_online(), alsa_answer(), alsa_call(), alsa_digit(), alsa_fixup(), alsa_hangup(), alsa_indicate(), alsa_read(), alsa_request(), alsa_text(), alsa_write(), ast_add_extension2(), ast_atomic_fetchadd_int_slow(), ast_cdr_detach(), ast_cdr_engine_init(), ast_cdr_submit_batch(), ast_channel_spy_stop_by_type(), ast_channel_whisper_feed(), ast_cli_netstats(), ast_config_engine_deregister(), ast_config_engine_register(), ast_context_add_ignorepat2(), ast_context_add_include2(), ast_context_add_switch2(), ast_context_find(), ast_context_lockmacro(), ast_context_remove_extension2(), ast_context_remove_ignorepat2(), ast_context_remove_include2(), ast_context_remove_switch2(), ast_db_del(), ast_db_deltree(), ast_db_get(), ast_db_gettree(), ast_db_put(), ast_dnsmgr_changed(), ast_enum_init(), ast_get_enum(), ast_get_txt(), ast_hint_extension(), ast_iax2_new(), ast_lock_context(), ast_lock_contexts(), ast_merge_contexts_and_delete(), ast_monitor_start(), ast_odbc_smart_execute(), ast_park_call(), ast_random(), ast_replace_sigchld(), ast_sched_add_variable(), ast_sched_del(), ast_sched_runq(), ast_sched_wait(), ast_sched_when(), ast_search_dns(), ast_unreplace_sigchld(), ast_write(), auth_fail(), auth_reject(), auto_hangup(), cb_events(), check_availability(), check_beep(), cl_dequeue_chan(), cl_queue_chan(), clear_config_maps(), config_command(), config_pgsql(), console_answer(), console_autoanswer(), console_dial(), console_hangup(), console_sendtext(), crypto_load(), database_show(), database_showkey(), decrease_call_count(), delete_devices(), delete_users(), destroy_endpoint(), destroy_peer(), destroy_session(), dialog_lock(), dialoglist_lock(), dnsmgr_refresh(), do_cdr(), do_monitor(), do_parking_thread(), do_reload(), dp_lookup(), dump_cmd_queues(), dump_queue(), features_answer(), features_call(), features_digit_begin(), features_digit_end(), features_fixup(), features_hangup(), features_indicate(), features_read(), features_show(), features_write(), find_call_locked(), find_callno(), find_command(), find_engine(), find_line_by_name(), find_session(), find_subchannel_and_lock(), find_tpeer(), get_input(), gethostbyname_r(), grab_owner(), gtalk_alloc(), gtalk_answer(), gtalk_digit(), gtalk_fixup(), gtalk_get_rtp_peer(), gtalk_hangup(), gtalk_newcall(), gtalk_read(), gtalk_set_rtp_peer(), gtalk_show_channels(), gtalk_write(), h323_reload(), handle_line_state_req_message(), handle_modlist(), handle_parkedcalls(), handle_request(), handle_save_dialplan(), iax2_bridge(), iax2_call(), iax2_destroy(), iax2_do_register(), iax2_fixup(), iax2_hangup(), iax2_poke_peer(), iax2_process_thread(), iax2_provision(), iax2_queue_frame(), iax2_request(), iax2_show_channels(), iax2_write(), iax_process_template(), iax_prov_complete_template(), iax_provision_build(), iax_provision_reload(), iax_provision_version(), iax_show_provisioning(), iax_template_parse(), increase_call_count(), jingle_alloc(), jingle_answer(), jingle_digit(), jingle_fixup(), jingle_get_rtp_peer(), jingle_hangup(), jingle_newcall(), jingle_read(), jingle_set_rtp_peer(), jingle_write(), kill_monitor(), load_module(), local_answer(), local_call(), local_digit_begin(), local_digit_end(), local_fixup(), local_hangup(), local_indicate(), local_queue_frame(), local_sendhtml(), local_sendtext(), local_write(), locals_show(), lock_both(), make_trunk(), manager_parking_status(), mgcp_answer(), mgcp_audit_endpoint(), mgcp_call(), mgcp_devicestate(), mgcp_fixup(), mgcp_hangup(), mgcp_indicate(), mgcp_postrequest(), mgcp_read(), mgcp_reload(), mgcp_senddigit_end(), mgcp_show_endpoints(), mgcp_write(), mgcpsock_read(), misdn_cfg_lock(), misdn_jb_empty(), misdn_jb_fill(), misdn_overlap_dial_task(), odbc_obj_connect(), odbc_obj_disconnect(), oh323_alloc(), oh323_answer(), oh323_call(), oh323_destroy(), oh323_digit_begin(), oh323_digit_end(), oh323_fixup(), oh323_get_rtp_peer(), oh323_hangup(), oh323_indicate(), oh323_read(), oh323_request(), oh323_simulate_dtmf_end(), oh323_update_info(), oh323_write(), park_exec(), pbx_extension_helper(), phone_request(), process_events(), process_message(), prune_gateways(), queue_frame_to_spies(), realtime_multi_pgsql(), realtime_pgsql(), reload(), reload_agents(), reload_config(), restart_monitor(), retrans_pkt(), rtp_bridge_lock(), sched_context_destroy(), sched_thread(), send_command_locked(), send_request(), set_eventmask(), setup_zap(), show_keys(), signal_condition(), sip_get_vrtp_peer(), sip_pvt_lock(), sip_reload(), sip_reload_check(), sip_set_udptl_peer(), sipnet_lock(), sipsock_read(), skinny_hangup(), skinny_read(), skinny_register(), skinny_req_parse(), skinny_reset_device(), skinny_show_devices(), skinny_show_lines(), skinny_write(), socket_process(), socket_process_meta(), spy_detach(), start_rtp(), submit_unscheduled_batch(), test_for_thread_safety(), test_thread_body(), timing_read(), transmit_response(), try_load_key(), unload_module(), update_pgsql(), verboser(), wakeup_sub(), zap_queue_frame(), zt_answer(), zt_bridge(), zt_call(), zt_digit_begin(), zt_digit_end(), zt_exception(), zt_fixup(), zt_func_read(), zt_handle_event(), zt_hangup(), zt_indicate(), zt_read(), zt_unlink(), and zt_write().

00534 {
00535    __MTX_PROF(pmutex);
00536 }

static int ast_mutex_trylock ast_mutex_t pmutex  )  [inline, static]
 

Definition at line 538 of file lock.h.

References pthread_mutex_trylock.

Referenced by agent_new(), ast_module_reload(), cache_get_callno_locked(), check_bridge(), dialoglist_lock(), do_monitor(), grab_owner(), iax2_destroy(), iax2_queue_frame(), local_queue_frame(), lock_both(), mgcp_queue_frame(), mgcp_queue_hangup(), network_thread(), refresh_list(), socket_process(), unload_module(), wakeup_sub(), zap_queue_frame(), zt_bridge(), zt_handle_event(), and zt_unlink().

00539 {
00540    return pthread_mutex_trylock(pmutex);
00541 }

static int ast_mutex_unlock ast_mutex_t pmutex  )  [inline, static]
 

Definition at line 523 of file lock.h.

References pthread_mutex_unlock.

Referenced by __ast_key_get(), __attempt_transmit(), __auth_reject(), __auto_congest(), __auto_hangup(), __get_from_jb(), __iax2_poke_noanswer(), __login_exec(), __manager_event(), __oh323_destroy(), __oh323_new(), __oh323_rtp_create(), __send_lagrq(), __send_ping(), __unload_module(), accept_thread(), action_agents(), action_challenge(), action_sendtext(), action_waitevent(), action_zapshowchannels(), agent_ack_sleep(), agent_call(), agent_cleanup(), agent_cont_sleep(), agent_devicestate(), agent_digit_begin(), agent_digit_end(), agent_fixup(), agent_hangup(), agent_indicate(), agent_new(), agent_read(), agent_request(), agent_sendhtml(), agent_sendtext(), agent_write(), agents_show(), agents_show_online(), alsa_answer(), alsa_call(), alsa_digit(), alsa_fixup(), alsa_hangup(), alsa_indicate(), alsa_read(), alsa_request(), alsa_text(), alsa_write(), answer_call(), ast_add_extension2(), ast_atomic_fetchadd_int_slow(), ast_cdr_detach(), ast_cdr_engine_init(), ast_cdr_submit_batch(), ast_channel_spy_stop_by_type(), ast_channel_whisper_feed(), ast_config_engine_register(), ast_context_add_ignorepat2(), ast_context_add_include2(), ast_context_add_switch2(), ast_context_find(), ast_context_remove_extension2(), ast_context_remove_ignorepat2(), ast_context_remove_include2(), ast_context_remove_switch2(), ast_context_unlockmacro(), ast_db_del(), ast_db_deltree(), ast_db_get(), ast_db_gettree(), ast_db_put(), ast_dnsmgr_changed(), ast_enum_init(), ast_get_enum(), ast_hint_extension(), ast_iax2_new(), ast_merge_contexts_and_delete(), ast_monitor_start(), ast_odbc_smart_execute(), ast_random(), ast_replace_sigchld(), ast_sched_add_variable(), ast_sched_del(), ast_sched_runq(), ast_sched_wait(), ast_sched_when(), ast_search_dns(), ast_unlock_context(), ast_unlock_contexts(), ast_unreplace_sigchld(), ast_write(), attempt_transfer(), auth_fail(), auth_reject(), auto_hangup(), cache_get_callno_locked(), cb_events(), chan_ringing(), check_availability(), check_beep(), check_bridge(), cl_dequeue_chan(), cl_queue_chan(), cleanup_connection(), clear_config_maps(), complete_ch_helper(), config_pgsql(), connection_made(), console_answer(), console_autoanswer(), console_dial(), console_hangup(), console_sendtext(), crypto_load(), database_show(), database_showkey(), decrease_call_count(), delete_users(), destroy_peer(), destroy_session(), dialog_lock(), dialoglist_unlock(), dnsmgr_refresh(), do_cdr(), do_monitor(), do_reload(), dp_lookup(), dump_cmd_queues(), dump_queue(), external_rtp_create(), features_answer(), features_call(), features_digit_begin(), features_digit_end(), features_hangup(), features_indicate(), features_read(), features_show(), features_write(), find_cache(), find_call_locked(), find_line_by_name(), find_session(), find_subchannel_and_lock(), get_input(), gethostbyname_r(), grab_owner(), gtalk_alloc(), gtalk_answer(), gtalk_digit(), gtalk_fixup(), gtalk_get_rtp_peer(), gtalk_hangup(), gtalk_newcall(), gtalk_read(), gtalk_set_rtp_peer(), gtalk_show_channels(), gtalk_write(), h323_reload(), handle_line_state_req_message(), handle_modlist(), handle_request(), handle_save_dialplan(), hangup_connection(), iax2_bridge(), iax2_call(), iax2_destroy(), iax2_do_register(), iax2_fixup(), iax2_hangup(), iax2_poke_peer(), iax2_process_thread(), iax2_provision(), iax2_queue_frame(), iax2_request(), iax2_trunk_queue(), iax2_write(), iax_process_template(), iax_provision_build(), iax_provision_reload(), iax_provision_version(), iax_template_parse(), increase_call_count(), jingle_alloc(), jingle_answer(), jingle_digit(), jingle_fixup(), jingle_get_rtp_peer(), jingle_hangup(), jingle_newcall(), jingle_read(), jingle_set_rtp_peer(), jingle_write(), kill_monitor(), load_module(), local_answer(), local_call(), local_digit_begin(), local_digit_end(), local_fixup(), local_hangup(), local_indicate(), local_queue_frame(), local_sendhtml(), local_sendtext(), local_write(), locals_show(), lock_both(), make_trunk(), mgcp_answer(), mgcp_audit_endpoint(), mgcp_call(), mgcp_devicestate(), mgcp_fixup(), mgcp_hangup(), mgcp_indicate(), mgcp_postrequest(), mgcp_queue_frame(), mgcp_queue_hangup(), mgcp_read(), mgcp_reload(), mgcp_request(), mgcp_senddigit_end(), mgcp_show_endpoints(), mgcp_write(), mgcpsock_read(), misdn_cfg_unlock(), misdn_jb_empty(), misdn_overlap_dial_task(), network_thread(), odbc_obj_connect(), odbc_obj_disconnect(), oh323_alloc(), oh323_answer(), oh323_call(), oh323_destroy(), oh323_digit_begin(), oh323_digit_end(), oh323_fixup(), oh323_get_rtp_peer(), oh323_hangup(), oh323_indicate(), oh323_read(), oh323_request(), oh323_simulate_dtmf_end(), oh323_update_info(), oh323_write(), park_exec(), pbx_extension_helper(), phone_request(), process_events(), process_message(), progress(), queue_frame_to_spies(), realtime_multi_pgsql(), realtime_pgsql(), receive_digit(), refresh_list(), reload(), reload_agents(), reload_config(), remote_hold(), restart_monitor(), retrans_pkt(), rtp_bridge_unlock(), sched_context_destroy(), sched_thread(), send_command_locked(), send_request(), set_dtmf_payload(), set_eventmask(), set_local_capabilities(), setup_rtp_connection(), setup_zap(), show_keys(), signal_condition(), sip_get_vrtp_peer(), sip_pvt_unlock(), sip_reload(), sip_reload_check(), sip_set_udptl_peer(), sipnet_unlock(), sipsock_read(), skinny_hangup(), skinny_read(), skinny_req_parse(), skinny_write(), socket_process(), socket_process_meta(), spy_detach(), start_rtp(), submit_unscheduled_batch(), test_for_thread_safety(), test_thread_body(), timing_read(), transmit_response(), try_load_key(), unload_module(), unlock_both(), update_pgsql(), verboser(), wakeup_sub(), zap_queue_frame(), zt_answer(), zt_bridge(), zt_call(), zt_digit_begin(), zt_digit_end(), zt_exception(), zt_func_read(), zt_handle_event(), zt_hangup(), zt_indicate(), zt_read(), zt_unlink(), and zt_write().

00524 {
00525    return pthread_mutex_unlock(pmutex);
00526 }

static int ast_rwlock_destroy ast_rwlock_t prwlock  )  [inline, static]
 

Definition at line 635 of file lock.h.

00636 {
00637    return pthread_rwlock_destroy(prwlock);
00638 }

static int ast_rwlock_init ast_rwlock_t prwlock  )  [inline, static]
 

Definition at line 622 of file lock.h.

00623 {
00624    pthread_rwlockattr_t attr;
00625 
00626    pthread_rwlockattr_init(&attr);
00627 
00628 #ifdef HAVE_PTHREAD_RWLOCK_PREFER_WRITER_NP
00629    pthread_rwlockattr_setkind_np(&attr, PTHREAD_RWLOCK_PREFER_WRITER_NP);
00630 #endif
00631 
00632    return pthread_rwlock_init(prwlock, &attr);
00633 }

static int ast_rwlock_rdlock ast_rwlock_t prwlock  )  [inline, static]
 

Definition at line 645 of file lock.h.

Referenced by ast_add_extension2(), complete_show_mancmd(), handle_show_globals(), handle_showmancmds(), pbx_builtin_getvar_helper(), pbx_retrieve_variable(), and process_message().

00646 {
00647    return pthread_rwlock_rdlock(prwlock);
00648 }

static int ast_rwlock_tryrdlock ast_rwlock_t prwlock  )  [inline, static]
 

Definition at line 650 of file lock.h.

00651 {
00652    return pthread_rwlock_tryrdlock(prwlock);
00653 }

static int ast_rwlock_trywrlock ast_rwlock_t prwlock  )  [inline, static]
 

Definition at line 660 of file lock.h.

00661 {
00662    return pthread_rwlock_trywrlock(prwlock);
00663 }

static int ast_rwlock_unlock ast_rwlock_t prwlock  )  [inline, static]
 

Definition at line 640 of file lock.h.

Referenced by ast_add_extension2(), ast_manager_register_struct(), handle_show_globals(), handle_showmancmds(), pbx_builtin_clear_globals(), pbx_builtin_getvar_helper(), pbx_builtin_pushvar_helper(), pbx_builtin_setvar_helper(), and pbx_retrieve_variable().

00641 {
00642    return pthread_rwlock_unlock(prwlock);
00643 }

static int ast_rwlock_wrlock ast_rwlock_t prwlock  )  [inline, static]
 

Definition at line 655 of file lock.h.

Referenced by ast_manager_register_struct(), ast_manager_unregister(), pbx_builtin_clear_globals(), pbx_builtin_pushvar_helper(), and pbx_builtin_setvar_helper().

00656 {
00657    return pthread_rwlock_wrlock(prwlock);
00658 }


Asterisk is a trademark for Digium, inc.. | Edvina.net | Asterisk.org | This documentation was generated with Doxygen