Defines | |
| #define | SWITCH_MUTEX_DEFAULT 0x0 |
| #define | SWITCH_MUTEX_NESTED 0x1 |
| #define | SWITCH_MUTEX_UNNESTED 0x2 |
Typedefs | |
| typedef apr_thread_mutex_t | switch_mutex_t |
Functions | |
| switch_status_t | switch_mutex_init (switch_mutex_t **lock, unsigned int flags, switch_memory_pool_t *pool) |
| switch_status_t | switch_mutex_destroy (switch_mutex_t *lock) |
| switch_status_t | switch_mutex_lock (switch_mutex_t *lock) |
| switch_status_t | switch_mutex_unlock (switch_mutex_t *lock) |
| switch_status_t | switch_mutex_trylock (switch_mutex_t *lock) |
|
|
platform-optimal lock behavior |
|
|
enable nested (recursive) locks |
|
|
disable nested locks |
|
|
Opaque thread-local mutex structure |
|
|
Destroy the mutex and free the memory associated with the lock.
00202 {
00203 return apr_thread_mutex_destroy(lock);
00204 }
|
|
||||||||||||||||
|
Create and initialize a mutex that can be used to synchronize threads.
00197 {
00198 return apr_thread_mutex_create(lock, flags, pool);
00199 }
|
|
|
Acquire the lock for the given mutex. If the mutex is already locked, the current thread will be put to sleep until the lock becomes available.
00207 {
00208 return apr_thread_mutex_lock(lock);
00209 }
|
|
|
Attempt to acquire the lock for the given mutex. If the mutex has already been acquired, the call returns immediately with APR_EBUSY. Note: it is important that the APR_STATUS_IS_EBUSY(s) macro be used to determine if the return value was APR_EBUSY, for portability reasons.
00217 {
00218 return apr_thread_mutex_trylock(lock);
00219 }
|
|
|
Release the lock for the given mutex.
00212 {
00213 return apr_thread_mutex_unlock(lock);
00214 }
|
1.3.9.1