Mistake on this page? Email us
Edge mutex API.

Files

file  edge_mutex.h
 Edge Mutex API.
 

Typedefs

typedef pthread_mutex_t edge_mutex_t
 

Functions

int32_t edge_mutex_init (edge_mutex_t *mutex, int32_t type)
 Initializes a mutex. More...
 
int32_t edge_mutex_destroy (edge_mutex_t *mutex)
 Destroys a mutex. The user is responsible to deallocate the memory for the mutex structure. More...
 
int32_t edge_mutex_lock (edge_mutex_t *mutex)
 Locks the mutex. More...
 
int32_t edge_mutex_unlock (edge_mutex_t *mutex)
 Unlocks the mutex. More...
 

Detailed Description

Function Documentation

int32_t edge_mutex_destroy ( edge_mutex_t *  mutex)

Destroys a mutex. The user is responsible to deallocate the memory for the mutex structure.

Parameters
mutexpointer to the mutex which should be destroyed.
int32_t edge_mutex_init ( edge_mutex_t *  mutex,
int32_t  type 
)

Initializes a mutex.

Parameters
mutexpointer to the mutex which should be initialized. The user is responsible to allocate the memory for the mutex data structure.
typeis used for setting mutex type using pthread_mutexattr_settype. See man pthread_mutex_attr. Allowed values are:
  • PTHREAD_MUTEX_NORMAL
  • PTHREAD_MUTEX_RECURSIVE
  • PTHREAD_MUTEX_ERRORCHECK _GNU_SOURCE compiler definition needs to be defined for these enums to be enabled.
int32_t edge_mutex_lock ( edge_mutex_t *  mutex)

Locks the mutex.

Parameters
mutexis a pointer to the mutex structure.
int32_t edge_mutex_unlock ( edge_mutex_t *  mutex)

Unlocks the mutex.

Parameters
mutexis a pointer to the mutex structure.