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

Typedefs

typedef struct fspr_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

◆ switch_thread_rwlock_t

typedef struct fspr_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_thread_rwlock_create()

switch_status_t switch_thread_rwlock_create ( switch_thread_rwlock_t **  rwlock,
switch_memory_pool_t pool 
)

Definition at line 235 of file switch_apr.c.

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

236 {
237  return fspr_thread_rwlock_create(rwlock, pool);
238 }
switch_memory_pool_t * pool
switch_thread_rwlock_t * rwlock
Definition: switch_event.c:75

◆ switch_thread_rwlock_destroy()

switch_status_t switch_thread_rwlock_destroy ( switch_thread_rwlock_t rwlock)

Definition at line 240 of file switch_apr.c.

241 {
242  return fspr_thread_rwlock_destroy(rwlock);
243 }
switch_thread_rwlock_t * rwlock
Definition: switch_event.c:75

◆ switch_thread_rwlock_pool_get()

switch_memory_pool_t* switch_thread_rwlock_pool_get ( switch_thread_rwlock_t rwlock)

Definition at line 245 of file switch_apr.c.

246 {
247  return fspr_thread_rwlock_pool_get(rwlock);
248 }
switch_thread_rwlock_t * rwlock
Definition: switch_event.c:75

◆ switch_thread_rwlock_rdlock()

switch_status_t switch_thread_rwlock_rdlock ( switch_thread_rwlock_t rwlock)

◆ switch_thread_rwlock_tryrdlock()

switch_status_t switch_thread_rwlock_tryrdlock ( switch_thread_rwlock_t rwlock)

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

256 {
257  return fspr_thread_rwlock_tryrdlock(rwlock);
258 }
switch_thread_rwlock_t * rwlock
Definition: switch_event.c:75

◆ switch_thread_rwlock_trywrlock()

switch_status_t switch_thread_rwlock_trywrlock ( switch_thread_rwlock_t rwlock)

Definition at line 265 of file switch_apr.c.

Referenced by do_shutdown(), and switch_thread_rwlock_trywrlock_timeout().

266 {
267  return fspr_thread_rwlock_trywrlock(rwlock);
268 }
switch_thread_rwlock_t * rwlock
Definition: switch_event.c:75

◆ switch_thread_rwlock_trywrlock_timeout()

switch_status_t switch_thread_rwlock_trywrlock_timeout ( switch_thread_rwlock_t rwlock,
int  timeout 
)

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

271 {
272  int sanity = timeout * 2;
273 
274  while (sanity) {
276  return SWITCH_STATUS_SUCCESS;
277  }
278  sanity--;
279  switch_yield(500000);
280  }
281 
282  return SWITCH_STATUS_FALSE;
283 }
#define switch_yield(ms)
Wait a desired number of microseconds and yield the CPU.
Definition: switch_utils.h:998
switch_thread_rwlock_t * rwlock
Definition: switch_event.c:75
switch_status_t switch_thread_rwlock_trywrlock(switch_thread_rwlock_t *rwlock)
Definition: switch_apr.c:265

◆ switch_thread_rwlock_unlock()

switch_status_t switch_thread_rwlock_unlock ( switch_thread_rwlock_t rwlock)

Definition at line 286 of file switch_apr.c.

Referenced by _switch_event_channel_broadcast(), do_chat_send(), 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_session_io_rwunlock(), switch_core_session_read_frame(), switch_core_session_read_lock(), switch_core_session_read_lock_hangup(), switch_core_session_read_text_frame(), 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_process(), 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().

287 {
288  return fspr_thread_rwlock_unlock(rwlock);
289 }
switch_thread_rwlock_t * rwlock
Definition: switch_event.c:75

◆ switch_thread_rwlock_wrlock()

switch_status_t switch_thread_rwlock_wrlock ( switch_thread_rwlock_t rwlock)