Tenok
A Linux-like Real-Time Operating System for Robotics and Internet of Things
Data Structures | Functions
mutex.h File Reference
#include <stdbool.h>
#include <common/list.h>
Include dependency graph for mutex.h:

Go to the source code of this file.

Data Structures

struct  mutex_attr
 
struct  mutex
 
struct  cond
 

Functions

int __mutex_lock (struct mutex *mtx)
 
void mutex_init (struct mutex *mtx)
 Initialize the mutex. More...
 
bool mutex_is_locked (struct mutex *mtx)
 Check if the mutex is locked or not. More...
 
int mutex_lock (struct mutex *mtx)
 Lock the mutex. More...
 
int mutex_unlock (struct mutex *mtx)
 Unlock the mutex. More...
 

Function Documentation

◆ mutex_init()

void mutex_init ( struct mutex mtx)

Initialize the mutex.

Parameters
mtxPointer to the mutex.
Return values
None

◆ mutex_is_locked()

bool mutex_is_locked ( struct mutex mtx)

Check if the mutex is locked or not.

Parameters
mtxPointer to the mutex.
Return values
booltrue or false.

◆ mutex_lock()

int mutex_lock ( struct mutex mtx)

Lock the mutex.

Parameters
mtxPointer to the mutex.
Return values
int0 on success and nonzero error number on error.

◆ mutex_unlock()

int mutex_unlock ( struct mutex mtx)

Unlock the mutex.

Parameters
mtxPointer to the mutex.
Return values
int0 on success and nonzero error number on error.