Read/Write Locking
[Core Library]

Collaboration diagram for Read/Write Locking:

Functions

switch_status_t switch_core_session_io_read_lock (switch_core_session_t *session)
switch_status_t switch_core_session_io_write_lock (switch_core_session_t *session)
switch_status_t switch_core_session_io_rwunlock (switch_core_session_t *session)
switch_status_t switch_core_session_read_lock (_In_ switch_core_session_t *session)
 Acquire a read lock on the session.
switch_status_t switch_core_session_read_lock_hangup (_In_ switch_core_session_t *session)
 Acquire a read lock on the session.
void switch_core_session_write_lock (_In_ switch_core_session_t *session)
 Acquire a write lock on the session.
void switch_core_session_rwunlock (_In_ switch_core_session_t *session)
 Unlock a read or write lock on as given session.


Function Documentation

switch_status_t switch_core_session_io_read_lock ( switch_core_session_t session  ) 

Definition at line 39 of file switch_core_rwlock.c.

References SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_thread_rwlock_tryrdlock().

Referenced by switch_ivr_get_file_handle().

00040 {
00041         switch_status_t status = SWITCH_STATUS_FALSE;
00042 
00043         if (session->io_rwlock) {
00044                 if (switch_thread_rwlock_tryrdlock(session->io_rwlock) == SWITCH_STATUS_SUCCESS) {
00045                         status = SWITCH_STATUS_SUCCESS;
00046                 }
00047         }
00048 
00049         return status;
00050 }

switch_status_t switch_core_session_io_rwunlock ( switch_core_session_t session  ) 

Definition at line 65 of file switch_core_rwlock.c.

References SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_thread_rwlock_unlock().

Referenced by switch_ivr_get_file_handle(), switch_ivr_play_file(), and switch_ivr_release_file_handle().

00066 {
00067         switch_status_t status = SWITCH_STATUS_FALSE;
00068 
00069         if (session->io_rwlock) {
00070                 switch_thread_rwlock_unlock(session->io_rwlock);
00071                 status = SWITCH_STATUS_SUCCESS;
00072         }
00073 
00074         return status;
00075 }

switch_status_t switch_core_session_io_write_lock ( switch_core_session_t session  ) 

Definition at line 52 of file switch_core_rwlock.c.

References SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, and switch_thread_rwlock_wrlock().

Referenced by switch_ivr_play_file().

00053 {
00054         switch_status_t status = SWITCH_STATUS_FALSE;
00055 
00056         if (session->io_rwlock) {
00057                 switch_thread_rwlock_wrlock(session->io_rwlock);
00058                 status = SWITCH_STATUS_SUCCESS;
00059         }
00060 
00061         return status;
00062 }

switch_status_t switch_core_session_read_lock ( _In_ switch_core_session_t session  ) 

Acquire a read lock on the session.

Parameters:
session the session to acquire from
Returns:
success if it is safe to read from the session

Referenced by bcast_thread(), collect_thread_run(), early_thread_run(), enterprise_originate_ringback_thread(), speech_thread(), switch_core_service_thread(), switch_core_session_event_send(), switch_core_session_hupall(), switch_core_session_hupall_endpoint(), switch_core_session_hupall_matching_var(), switch_core_session_locate(), switch_core_session_message_send(), switch_core_session_receive_event(), switch_ivr_eavesdrop_pop_eavesdropper(), and switch_ivr_multi_threaded_bridge().

switch_status_t switch_core_session_read_lock_hangup ( _In_ switch_core_session_t session  ) 

Acquire a read lock on the session.

Parameters:
session the session to acquire from
Returns:
success if it is safe to read from the session

Referenced by CoreSession::CoreSession(), and switch_core_session_perform_receive_message().

void switch_core_session_rwunlock ( _In_ switch_core_session_t session  ) 

Unlock a read or write lock on as given session.

Parameters:
session the session

Referenced by audio_bridge_thread(), bcast_thread(), check_channel_status(), cleanup_proxy_mode_a(), collect_thread_run(), CoreSession::destroy(), enterprise_originate_ringback_thread(), enterprise_originate_thread(), fs_core_session_locate(), fs_switch_ivr_originate(), rtp_common_read(), sb_on_dtmf(), signal_bridge_on_hangup(), signal_bridge_on_hibernate(), speech_thread(), switch_channel_check_zrtp(), switch_channel_clear_flag_partner(), switch_channel_get_hold_music_partner(), switch_channel_get_private_partner(), switch_channel_get_variable_partner(), switch_channel_mark_hold(), switch_channel_perform_mark_answered(), switch_channel_perform_mark_pre_answered(), switch_channel_perform_mark_ring_ready_value(), switch_channel_set_flag_partner(), switch_channel_set_variable_partner_var_check(), switch_channel_test_cap_partner(), switch_channel_test_flag_partner(), switch_core_media_bug_read(), switch_core_service_thread(), switch_core_session_event_send(), switch_core_session_hupall(), switch_core_session_hupall_endpoint(), switch_core_session_hupall_matching_var(), switch_core_session_message_send(), switch_core_session_pass_indication(), switch_core_session_perform_receive_message(), switch_core_session_receive_event(), switch_core_session_thread(), switch_core_session_write_frame(), switch_core_standard_on_execute(), switch_ivr_blind_transfer_ack(), switch_ivr_broadcast(), switch_ivr_eavesdrop_session(), switch_ivr_find_bridged_uuid(), switch_ivr_hold_uuid(), switch_ivr_intercept_session(), switch_ivr_kill_uuid(), switch_ivr_media(), switch_ivr_multi_threaded_bridge(), switch_ivr_nomedia(), switch_ivr_parse_event(), switch_ivr_record_session(), switch_ivr_session_transfer(), switch_ivr_soft_hold(), switch_ivr_unhold(), switch_ivr_unhold_uuid(), switch_ivr_uuid_bridge(), switch_ivr_uuid_exists(), switch_rtp_write_frame(), switch_rtp_zerocopy_read_frame(), SWITCH_STANDARD_SCHED_FUNC(), and uuid_bridge_on_soft_execute().

void switch_core_session_write_lock ( _In_ switch_core_session_t session  ) 

Acquire a write lock on the session.

Parameters:
session the session to acquire from

Referenced by switch_core_session_thread().


Generated on Wed May 16 04:00:18 2012 for FreeSWITCH API Documentation by  doxygen 1.4.7