WARNING: The online documentation has moved to https://docs.pjsip.org.

Visit the new documentation at https://docs.pjsip.org:

BLOG | DOCUMENTATION | GITHUB

Home --> Documentations --> PJLIB Reference

Typedefs

typedef struct pj_rwmutex_t pj_rwmutex_t
 

Functions

pj_status_t pj_rwmutex_create (pj_pool_t *pool, const char *name, pj_rwmutex_t **mutex)
 
pj_status_t pj_rwmutex_lock_read (pj_rwmutex_t *mutex)
 
pj_status_t pj_rwmutex_lock_write (pj_rwmutex_t *mutex)
 
pj_status_t pj_rwmutex_unlock_read (pj_rwmutex_t *mutex)
 
pj_status_t pj_rwmutex_unlock_write (pj_rwmutex_t *mutex)
 
pj_status_t pj_rwmutex_destroy (pj_rwmutex_t *mutex)
 

Detailed Description

Reader/writer mutex is a classic synchronization object where multiple readers can acquire the mutex, but only a single writer can acquire the mutex.

Typedef Documentation

◆ pj_rwmutex_t

typedef struct pj_rwmutex_t 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.

Function Documentation

◆ pj_rwmutex_create()

pj_status_t pj_rwmutex_create ( pj_pool_t pool,
const char *  name,
pj_rwmutex_t **  mutex 
)

Create reader/writer mutex.

Parameters
poolPool to allocate memory for the mutex.
nameName to be assigned to the mutex.
mutexPointer to receive the newly created mutex.
Returns
PJ_SUCCESS on success, or the error code.

◆ pj_rwmutex_destroy()

pj_status_t pj_rwmutex_destroy ( pj_rwmutex_t mutex)

Destroy reader/writer mutex.

Parameters
mutexThe mutex.
Returns
PJ_SUCCESS on success, or the error code.

◆ pj_rwmutex_lock_read()

pj_status_t pj_rwmutex_lock_read ( pj_rwmutex_t mutex)

Lock the mutex for reading.

Parameters
mutexThe mutex.
Returns
PJ_SUCCESS on success, or the error code.

◆ pj_rwmutex_lock_write()

pj_status_t pj_rwmutex_lock_write ( pj_rwmutex_t mutex)

Lock the mutex for writing.

Parameters
mutexThe mutex.
Returns
PJ_SUCCESS on success, or the error code.

◆ pj_rwmutex_unlock_read()

pj_status_t pj_rwmutex_unlock_read ( pj_rwmutex_t mutex)

Release read lock.

Parameters
mutexThe mutex.
Returns
PJ_SUCCESS on success, or the error code.

◆ pj_rwmutex_unlock_write()

pj_status_t pj_rwmutex_unlock_write ( pj_rwmutex_t mutex)

Release write lock.

Parameters
mutexThe mutex.
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.