FreeSWITCH API Documentation  1.7.0
Functions
Read/Write Locking
+ 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. More...
 
switch_status_t switch_core_session_read_lock_hangup (_In_ switch_core_session_t *session)
 Acquire a read lock on the session. More...
 
void switch_core_session_write_lock (_In_ switch_core_session_t *session)
 Acquire a write lock on the session. More...
 
void switch_core_session_rwunlock (_In_ switch_core_session_t *session)
 Unlock a read or write lock on as given session. More...
 

Detailed Description

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().

40 {
42 
43  if (session->io_rwlock) {
45  status = SWITCH_STATUS_SUCCESS;
46  }
47  }
48 
49  return status;
50 }
switch_status_t switch_thread_rwlock_tryrdlock(switch_thread_rwlock_t *rwlock)
Definition: switch_apr.c:232
switch_thread_rwlock_t * io_rwlock
switch_status_t
Common return values.
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().

66 {
68 
69  if (session->io_rwlock) {
71  status = SWITCH_STATUS_SUCCESS;
72  }
73 
74  return status;
75 }
switch_status_t switch_thread_rwlock_unlock(switch_thread_rwlock_t *rwlock)
Definition: switch_apr.c:263
switch_thread_rwlock_t * io_rwlock
switch_status_t
Common return values.
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().

53 {
55 
56  if (session->io_rwlock) {
58  status = SWITCH_STATUS_SUCCESS;
59  }
60 
61  return status;
62 }
switch_status_t switch_thread_rwlock_wrlock(switch_thread_rwlock_t *rwlock)
Definition: switch_apr.c:237
switch_thread_rwlock_t * io_rwlock
switch_status_t
Common return values.
switch_status_t switch_core_session_read_lock ( _In_ switch_core_session_t session)
switch_status_t switch_core_session_read_lock_hangup ( _In_ switch_core_session_t session)

Acquire a read lock on the session.

Parameters
sessionthe 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
sessionthe session

Referenced by audio_bridge_thread(), bcast_thread(), check_channel_status(), cleanup_proxy_mode_a(), collect_thread_run(), CoreSession::destroy(), dtls_state_ready(), early_thread_run(), eavesdrop_callback(), enterprise_originate_ringback_thread(), enterprise_originate_thread(), fs_core_session_locate(), fs_switch_ivr_originate(), recording_thread(), 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_gen_local_sdp(), switch_core_media_negotiate_sdp(), switch_core_media_pass_zrtp_hash(), switch_core_media_receive_message(), switch_core_media_toggle_hold(), switch_core_service_thread(), switch_core_session_event_send(), switch_core_session_findall(), switch_core_session_findall_matching_var(), switch_core_session_hupall(), switch_core_session_hupall_endpoint(), switch_core_session_hupall_matching_var_ans(), switch_core_session_message_send(), switch_core_session_pass_indication(), switch_core_session_perform_receive_message(), switch_core_session_read_frame(), switch_core_session_receive_event(), switch_core_session_thread(), switch_core_session_write_frame(), switch_core_standard_on_execute(), switch_core_standard_on_reset(), switch_ivr_3p_media(), switch_ivr_3p_nomedia(), switch_ivr_blind_transfer_ack(), switch_ivr_broadcast(), switch_ivr_eavesdrop_session(), switch_ivr_find_bridged_uuid(), switch_ivr_hold_toggle_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_originate(), 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_ivr_uuid_force_exists(), switch_rtp_write_frame(), switch_rtp_zerocopy_read_frame(), SWITCH_STANDARD_SCHED_FUNC(), uuid_bridge_on_soft_execute(), video_helper_thread(), and video_write_thread().

void switch_core_session_write_lock ( _In_ switch_core_session_t session)

Acquire a write lock on the session.

Parameters
sessionthe session to acquire from

Referenced by switch_core_session_thread().