CNDP  22.08.0
cne_mutex_helper.h File Reference
#include <pthread.h>
#include <cne_log.h>

Go to the source code of this file.

Functions

static int cne_mutex_create (pthread_mutex_t *mutex, int flags)
 
static int cne_mutex_destroy (pthread_mutex_t *mutex)
 

Detailed Description

Routines to help create a mutex.

Definition in file cne_mutex_helper.h.

Function Documentation

◆ cne_mutex_create()

static int cne_mutex_create ( pthread_mutex_t *  mutex,
int  flags 
)
inlinestatic

Helper routine to create a mutex with a specific type.

Parameters
mutexThe pointer to the mutex to create.
flagsThe attribute flags used to create the mutex i.e. recursive attribute
Returns
0 on success or -1 on failure errno is set

Definition at line 31 of file cne_mutex_helper.h.

◆ cne_mutex_destroy()

static int cne_mutex_destroy ( pthread_mutex_t *  mutex)
inlinestatic

Destroy a mutex

Parameters
mutexPointer to mutex to destroy.
Returns
0 on success and -1 on error with errno set.

Definition at line 78 of file cne_mutex_helper.h.