Thread Read/Write lock Routines
[Brought To You By APR]

Collaboration diagram for Thread Read/Write lock Routines:

Typedefs

typedef 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)


Typedef Documentation

typedef struct apr_thread_rwlock_t switch_thread_rwlock_t

Opaque structure used for the rwlock

Definition at line 485 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 234 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().

00235 {
00236         return apr_thread_rwlock_create(rwlock, pool);
00237 }

switch_status_t switch_thread_rwlock_destroy ( switch_thread_rwlock_t rwlock  ) 

Definition at line 239 of file switch_apr.c.

00240 {
00241         return apr_thread_rwlock_destroy(rwlock);
00242 }

switch_memory_pool_t* switch_thread_rwlock_pool_get ( switch_thread_rwlock_t rwlock  ) 

Definition at line 244 of file switch_apr.c.

00245 {
00246         return apr_thread_rwlock_pool_get(rwlock);
00247 }

switch_status_t switch_thread_rwlock_rdlock ( switch_thread_rwlock_t rwlock  ) 

Definition at line 249 of file switch_apr.c.

Referenced by switch_core_get_variable(), switch_core_get_variable_dup(), switch_core_get_variable_pdup(), switch_core_hash_find_rdlock(), switch_core_media_bug_count(), switch_core_media_bug_enumerate(), switch_core_session_write_frame(), switch_event_deliver(), and switch_xml_locate().

00250 {
00251         return apr_thread_rwlock_rdlock(rwlock);
00252 }

switch_status_t switch_thread_rwlock_tryrdlock ( switch_thread_rwlock_t rwlock  ) 

Definition at line 254 of file switch_apr.c.

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

00255 {
00256         return apr_thread_rwlock_tryrdlock(rwlock);
00257 }

switch_status_t switch_thread_rwlock_trywrlock ( switch_thread_rwlock_t rwlock  ) 

Definition at line 264 of file switch_apr.c.

Referenced by do_shutdown(), and switch_thread_rwlock_trywrlock_timeout().

00265 {
00266         return apr_thread_rwlock_trywrlock(rwlock);
00267 }

switch_status_t switch_thread_rwlock_trywrlock_timeout ( switch_thread_rwlock_t rwlock,
int  timeout 
)

Definition at line 269 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().

00270 {
00271         int sanity = timeout * 2;
00272 
00273         while (sanity) {
00274                 if (switch_thread_rwlock_trywrlock(rwlock) == SWITCH_STATUS_SUCCESS) {
00275                         return SWITCH_STATUS_SUCCESS;
00276                 }
00277                 sanity--;
00278                 switch_yield(500000);
00279         }
00280 
00281         return SWITCH_STATUS_FALSE;
00282 }

switch_status_t switch_thread_rwlock_unlock ( switch_thread_rwlock_t rwlock  ) 

Definition at line 285 of file switch_apr.c.

Referenced by do_shutdown(), switch_core_get_variable(), switch_core_get_variable_dup(), switch_core_get_variable_pdup(), 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_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_recordings(), switch_core_session_io_rwunlock(), switch_core_session_read_lock(), switch_core_session_rwunlock(), switch_core_session_set_real_read_codec(), switch_core_session_write_frame(), switch_core_set_var_conditional(), switch_core_set_variable(), switch_core_unset_variables(), switch_event_bind_removable(), switch_event_deliver(), switch_event_free_subclass_detailed(), switch_event_unbind(), switch_loadable_module_unprocess(), switch_xml_bind_search_function_ret(), and switch_xml_unbind_search_function().

00286 {
00287         return apr_thread_rwlock_unlock(rwlock);
00288 }

switch_status_t switch_thread_rwlock_wrlock ( switch_thread_rwlock_t rwlock  ) 

Definition at line 259 of file switch_apr.c.

Referenced by switch_core_hash_delete_wrlock(), switch_core_hash_insert_wrlock(), switch_core_media_bug_add(), switch_core_media_bug_exec_all(), switch_core_media_bug_flush_all(), 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_recordings(), switch_core_session_io_write_lock(), switch_core_session_set_real_read_codec(), switch_core_session_write_lock(), switch_core_set_var_conditional(), switch_core_set_variable(), switch_core_unset_variables(), switch_event_bind_removable(), switch_event_free_subclass_detailed(), switch_event_unbind(), switch_event_unbind_callback(), switch_xml_bind_search_function_ret(), switch_xml_unbind_search_function(), and switch_xml_unbind_search_function_ptr().

00260 {
00261         return apr_thread_rwlock_wrlock(rwlock);
00262 }


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