Main Page | Modules | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

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


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


Function Documentation

switch_status_t switch_thread_rwlock_create switch_thread_rwlock_t **  rwlock,
switch_memory_pool_t pool
 

00139 {
00140         return apr_thread_rwlock_create(rwlock, pool);
00141 }

switch_status_t switch_thread_rwlock_destroy switch_thread_rwlock_t rwlock  ) 
 

00144 {
00145         return apr_thread_rwlock_destroy(rwlock);
00146 }

switch_memory_pool_t* switch_thread_rwlock_pool_get switch_thread_rwlock_t rwlock  ) 
 

00149 {
00150         return apr_thread_rwlock_pool_get(rwlock);
00151 }

switch_status_t switch_thread_rwlock_rdlock switch_thread_rwlock_t rwlock  ) 
 

00154 {
00155         return apr_thread_rwlock_rdlock(rwlock);
00156 }

switch_status_t switch_thread_rwlock_tryrdlock switch_thread_rwlock_t rwlock  ) 
 

00159 {
00160         return apr_thread_rwlock_tryrdlock(rwlock);
00161 }

switch_status_t switch_thread_rwlock_trywrlock switch_thread_rwlock_t rwlock  ) 
 

00169 {
00170         return apr_thread_rwlock_trywrlock(rwlock);
00171 }

switch_status_t switch_thread_rwlock_trywrlock_timeout switch_thread_rwlock_t rwlock,
int  timeout
 

00174 {
00175         int sanity = timeout * 2;
00176 
00177         while (sanity) {
00178                 if (switch_thread_rwlock_trywrlock(rwlock) == SWITCH_STATUS_SUCCESS) {
00179                         return SWITCH_STATUS_SUCCESS;
00180                 }
00181                 sanity--;
00182                 switch_yield(500000);
00183         }
00184 
00185         return SWITCH_STATUS_FALSE;
00186 }

Here is the call graph for this function:

switch_status_t switch_thread_rwlock_unlock switch_thread_rwlock_t rwlock  ) 
 

00190 {
00191         return apr_thread_rwlock_unlock(rwlock);
00192 }

switch_status_t switch_thread_rwlock_wrlock switch_thread_rwlock_t rwlock  ) 
 

00164 {
00165         return apr_thread_rwlock_wrlock(rwlock);
00166 }


Generated on Fri Oct 10 11:24:22 2008 for FreeSWITCH by  doxygen 1.3.9.1