Home --> Documentations --> PJLIB Reference
|
enum | pj_mutex_type_e { PJ_MUTEX_DEFAULT
, PJ_MUTEX_SIMPLE
, PJ_MUTEX_RECURSE
} |
|
Mutex manipulation. Alternatively, application can use higher abstraction for lock objects, which provides uniform API for all kinds of lock mechanisms, including mutex. See Lock Objects for more information.
◆ pj_mutex_type_e
Mutex types:
- PJ_MUTEX_DEFAULT: default mutex type, which is system dependent.
- PJ_MUTEX_SIMPLE: non-recursive mutex.
- PJ_MUTEX_RECURSE: recursive mutex.
◆ pj_mutex_create()
Create mutex of the specified type.
- Parameters
-
pool | The pool. |
name | Name to be associated with the mutex (for debugging). |
type | The type of the mutex, of type pj_mutex_type_e. |
mutex | Pointer to hold the returned mutex instance. |
- Returns
- PJ_SUCCESS on success, or the error code.
◆ pj_mutex_create_recursive()
Create recursive mutex. This function is a simple wrapper for pj_mutex_create to create recursive mutex.
- Parameters
-
pool | The pool. |
name | Mutex name. |
mutex | Pointer to hold the returned mutex instance. |
- Returns
- PJ_SUCCESS on success, or the error code.
◆ pj_mutex_create_simple()
Create simple, non-recursive mutex. This function is a simple wrapper for pj_mutex_create to create non-recursive mutex.
- Parameters
-
pool | The pool. |
name | Mutex name. |
mutex | Pointer to hold the returned mutex instance. |
- Returns
- PJ_SUCCESS on success, or the error code.
◆ pj_mutex_destroy()
Destroy mutex.
- Parameters
-
- Returns
- PJ_SUCCESS on success, or the error code.
◆ pj_mutex_is_locked()
Determine whether calling thread is owning the mutex (only available when PJ_DEBUG is set). - Parameters
-
- Returns
- Non-zero if yes.
◆ pj_mutex_lock()
Acquire mutex lock.
- Parameters
-
- Returns
- PJ_SUCCESS on success, or the error code.
◆ pj_mutex_trylock()
Try to acquire mutex lock.
- Parameters
-
- Returns
- PJ_SUCCESS on success, or the error code if the lock couldn't be acquired.
◆ pj_mutex_unlock()
Release mutex lock.
- Parameters
-
- Returns
- PJ_SUCCESS on success, or the error code.
PJLIB Open Source, high performance, small footprint, and very very portable framework
Copyright (C) 2006-2009 Teluu Inc.
|