Mercury
Typedefs | Functions
mercury_thread_mutex.h File Reference
#include "mercury_util_config.h"
#include <pthread.h>
#include <errno.h>
Include dependency graph for mercury_thread_mutex.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef pthread_mutex_t hg_thread_mutex_t
 

Functions

HG_UTIL_EXPORT int hg_thread_mutex_init (hg_thread_mutex_t *mutex)
 Initialize the mutex. More...
 
HG_UTIL_EXPORT int hg_thread_mutex_destroy (hg_thread_mutex_t *mutex)
 Destroy the mutex. More...
 
HG_UTIL_EXPORT int hg_thread_mutex_lock (hg_thread_mutex_t *mutex)
 Lock the mutex. More...
 
HG_UTIL_EXPORT int hg_thread_mutex_try_lock (hg_thread_mutex_t *mutex)
 Try locking the mutex. More...
 
HG_UTIL_EXPORT int hg_thread_mutex_unlock (hg_thread_mutex_t *mutex)
 Unlock the mutex. More...
 

Typedef Documentation

typedef pthread_mutex_t hg_thread_mutex_t

Definition at line 21 of file mercury_thread_mutex.h.

Function Documentation

HG_UTIL_EXPORT int hg_thread_mutex_init ( hg_thread_mutex_t mutex)

Initialize the mutex.

Parameters
mutex[IN/OUT] pointer to mutex object
Returns
Non-negative on success or negative on failure
HG_UTIL_EXPORT int hg_thread_mutex_destroy ( hg_thread_mutex_t mutex)

Destroy the mutex.

Parameters
mutex[IN/OUT] pointer to mutex object
Returns
Non-negative on success or negative on failure
HG_UTIL_EXPORT int hg_thread_mutex_lock ( hg_thread_mutex_t mutex)

Lock the mutex.

Parameters
mutex[IN/OUT] pointer to mutex object
Returns
Non-negative on success or negative on failure
HG_UTIL_EXPORT int hg_thread_mutex_try_lock ( hg_thread_mutex_t mutex)

Try locking the mutex.

Parameters
mutex[IN/OUT] pointer to mutex object
Returns
Non-negative on success or negative on failure
HG_UTIL_EXPORT int hg_thread_mutex_unlock ( hg_thread_mutex_t mutex)

Unlock the mutex.

Parameters
mutex[IN/OUT] pointer to mutex object
Returns
Non-negative on success or negative on failure