Reader/writer mutex is a classic synchronization object where multiple readers can acquire the mutex, but only a single writer can acquire the mutex.
◆ pj_rwmutex_t
Opaque declaration for reader/writer mutex. Reader/writer mutex is a classic synchronization object where multiple readers can acquire the mutex, but only a single writer can acquire the mutex.
◆ pj_rwmutex_create()
Create reader/writer mutex.
- Parameters
-
pool | Pool to allocate memory for the mutex. |
name | Name to be assigned to the mutex. |
mutex | Pointer to receive the newly created mutex. |
- Returns
- PJ_SUCCESS on success, or the error code.
◆ pj_rwmutex_destroy()
Destroy reader/writer mutex.
- Parameters
-
- Returns
- PJ_SUCCESS on success, or the error code.
◆ pj_rwmutex_lock_read()
Lock the mutex for reading.
- Parameters
-
- Returns
- PJ_SUCCESS on success, or the error code.
◆ pj_rwmutex_lock_write()
Lock the mutex for writing.
- Parameters
-
- Returns
- PJ_SUCCESS on success, or the error code.
◆ pj_rwmutex_unlock_read()
Release read lock.
- Parameters
-
- Returns
- PJ_SUCCESS on success, or the error code.
◆ pj_rwmutex_unlock_write()
Release write lock.
- Parameters
-
- Returns
- PJ_SUCCESS on success, or the error code.