FreeSWITCH API Documentation  1.7.0
Typedefs | Functions
Thread Read/Write lock Routines
+ Collaboration diagram for Thread Read/Write lock Routines:

Typedefs

typedef struct apr_thread_rwlock_t switch_thread_rwlock_t
 

Functions

switch_status_t switch_thread_rwlock_create (switch_thread_rwlock_t **rwlock, switch_memory_pool_t *pool)
 
switch_status_t switch_thread_rwlock_destroy (switch_thread_rwlock_t *rwlock)
 
switch_memory_pool_tswitch_thread_rwlock_pool_get (switch_thread_rwlock_t *rwlock)
 
switch_status_t switch_thread_rwlock_rdlock (switch_thread_rwlock_t *rwlock)
 
switch_status_t switch_thread_rwlock_tryrdlock (switch_thread_rwlock_t *rwlock)
 
switch_status_t switch_thread_rwlock_wrlock (switch_thread_rwlock_t *rwlock)
 
switch_status_t switch_thread_rwlock_trywrlock (switch_thread_rwlock_t *rwlock)
 
switch_status_t switch_thread_rwlock_trywrlock_timeout (switch_thread_rwlock_t *rwlock, int timeout)
 
switch_status_t switch_thread_rwlock_unlock (switch_thread_rwlock_t *rwlock)
 

Detailed Description

Typedef Documentation

typedef struct apr_thread_rwlock_t switch_thread_rwlock_t

Opaque structure used for the rwlock

Definition at line 436 of file switch_apr.h.

Function Documentation

switch_status_t switch_thread_rwlock_create ( switch_thread_rwlock_t **  rwlock,
switch_memory_pool_t pool 
)

Definition at line 212 of file switch_apr.c.

Referenced by switch_core_init(), switch_core_session_request_uuid(), switch_event_init(), switch_loadable_module_create_module_interface(), and switch_xml_init().

213 {
214  return apr_thread_rwlock_create(rwlock, pool);
215 }
switch_memory_pool_t * pool
switch_thread_rwlock_t * rwlock
Definition: switch_event.c:73
switch_status_t switch_thread_rwlock_destroy ( switch_thread_rwlock_t rwlock)

Definition at line 217 of file switch_apr.c.

218 {
219  return apr_thread_rwlock_destroy(rwlock);
220 }
switch_thread_rwlock_t * rwlock
Definition: switch_event.c:73
switch_memory_pool_t* switch_thread_rwlock_pool_get ( switch_thread_rwlock_t rwlock)

Definition at line 222 of file switch_apr.c.

223 {
224  return apr_thread_rwlock_pool_get(rwlock);
225 }
switch_thread_rwlock_t * rwlock
Definition: switch_event.c:73
switch_status_t switch_thread_rwlock_rdlock ( switch_thread_rwlock_t rwlock)
switch_status_t switch_thread_rwlock_tryrdlock ( switch_thread_rwlock_t rwlock)

Definition at line 232 of file switch_apr.c.

Referenced by switch_core_session_io_read_lock(), switch_core_session_perform_force_locate(), switch_core_session_read_lock(), and switch_core_session_read_lock_hangup().

233 {
234  return apr_thread_rwlock_tryrdlock(rwlock);
235 }
switch_thread_rwlock_t * rwlock
Definition: switch_event.c:73
switch_status_t switch_thread_rwlock_trywrlock ( switch_thread_rwlock_t rwlock)

Definition at line 242 of file switch_apr.c.

Referenced by do_shutdown(), and switch_thread_rwlock_trywrlock_timeout().

243 {
244  return apr_thread_rwlock_trywrlock(rwlock);
245 }
switch_thread_rwlock_t * rwlock
Definition: switch_event.c:73
switch_status_t switch_thread_rwlock_trywrlock_timeout ( switch_thread_rwlock_t rwlock,
int  timeout 
)

Definition at line 247 of file switch_apr.c.

References SWITCH_STATUS_FALSE, SWITCH_STATUS_SUCCESS, switch_thread_rwlock_trywrlock(), and switch_yield.

Referenced by switch_loadable_module_unprocess().

248 {
249  int sanity = timeout * 2;
250 
251  while (sanity) {
253  return SWITCH_STATUS_SUCCESS;
254  }
255  sanity--;
256  switch_yield(500000);
257  }
258 
259  return SWITCH_STATUS_FALSE;
260 }
#define switch_yield(ms)
Wait a desired number of microseconds and yield the CPU.
Definition: switch_utils.h:908
switch_thread_rwlock_t * rwlock
Definition: switch_event.c:73
switch_status_t switch_thread_rwlock_trywrlock(switch_thread_rwlock_t *rwlock)
Definition: switch_apr.c:242
switch_status_t switch_thread_rwlock_unlock ( switch_thread_rwlock_t rwlock)

Definition at line 263 of file switch_apr.c.

Referenced by _switch_event_channel_broadcast(), do_shutdown(), perform_write(), switch_core_get_domain(), switch_core_get_variable(), switch_core_get_variable_dup(), switch_core_get_variable_pdup(), switch_core_get_variables(), switch_core_hash_delete_wrlock(), switch_core_hash_find_rdlock(), switch_core_hash_insert_wrlock(), switch_core_media_bug_add(), switch_core_media_bug_count(), switch_core_media_bug_enumerate(), switch_core_media_bug_exec_all(), switch_core_media_bug_flush_all(), switch_core_media_bug_patch_video(), switch_core_media_bug_pop(), switch_core_media_bug_prune(), switch_core_media_bug_remove(), switch_core_media_bug_remove_all_function(), switch_core_media_bug_remove_callback(), switch_core_media_bug_transfer_callback(), switch_core_media_bug_transfer_recordings(), switch_core_session_io_rwunlock(), switch_core_session_read_frame(), switch_core_session_read_lock(), switch_core_session_read_video_frame(), switch_core_session_rwunlock(), switch_core_session_set_real_read_codec(), switch_core_session_write_frame(), switch_core_session_write_video_frame(), switch_core_set_var_conditional(), switch_core_set_variable(), switch_core_unset_variables(), switch_event_bind_removable(), switch_event_channel_bind(), switch_event_channel_permission_clear(), switch_event_channel_permission_modify(), switch_event_channel_permission_verify(), switch_event_channel_sub_channel(), switch_event_channel_unsub_channel(), switch_event_deliver(), switch_event_free_subclass_detailed(), switch_event_unbind(), switch_event_unbind_callback(), switch_loadable_module_unprocess(), switch_xml_bind_search_function_ret(), switch_xml_locate(), switch_xml_unbind_search_function(), switch_xml_unbind_search_function_ptr(), unsub_all_switch_event_channel(), and video_bug_thread().

264 {
265  return apr_thread_rwlock_unlock(rwlock);
266 }
switch_thread_rwlock_t * rwlock
Definition: switch_event.c:73
switch_status_t switch_thread_rwlock_wrlock ( switch_thread_rwlock_t rwlock)