distortos  v0.6.0
object-oriented C++ RTOS for microcontrollers
Mutex.h File Reference

Header of C-API for distortos::Mutex. More...

#include "estd/C-API/IntrusiveList.h"
#include <stdint.h>
Include dependency graph for Mutex.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  distortos_Mutex
 C-API equivalent of distortos::Mutex. More...
 

Macros

#define DISTORTOS_MUTEX_INITIALIZER(self, type, protocol, priorityCeiling)
 Initializer for distortos_Mutex. More...
 
#define DISTORTOS_MUTEX_CONSTRUCT_3(name, type, protocol, priorityCeiling)   struct distortos_Mutex name = DISTORTOS_MUTEX_INITIALIZER(name, type, protocol, priorityCeiling)
 C-API equivalent of distortos::Mutex's constructor. More...
 
#define DISTORTOS_MUTEX_CONSTRUCT_2PC(name, protocol, priorityCeiling)   DISTORTOS_MUTEX_CONSTRUCT_3(name, distortos_Mutex_Type_normal, protocol, priorityCeiling)
 C-API equivalent of distortos::Mutex's constructor, type = distortos_Mutex_Type_normal. More...
 
#define DISTORTOS_MUTEX_CONSTRUCT_2TP(name, type, protocol)   DISTORTOS_MUTEX_CONSTRUCT_3(name, type, protocol, 0)
 C-API equivalent of distortos::Mutex's constructor, priorityCeiling = 0. More...
 
#define DISTORTOS_MUTEX_CONSTRUCT_1P(name, protocol)   DISTORTOS_MUTEX_CONSTRUCT_3(name, distortos_Mutex_Type_normal, protocol, 0)
 C-API equivalent of distortos::Mutex's constructor, type = distortos_Mutex_Type_normal, priorityCeiling = 0. More...
 
#define DISTORTOS_MUTEX_CONSTRUCT_1T(name, type)   DISTORTOS_MUTEX_CONSTRUCT_3(name, type, distortos_Mutex_Protocol_none, 0)
 C-API equivalent of distortos::Mutex's constructor, protocol = distortos_Mutex_Protocol_none, priorityCeiling = 0. More...
 
#define DISTORTOS_MUTEX_CONSTRUCT(name)   DISTORTOS_MUTEX_CONSTRUCT_3(name, distortos_Mutex_Type_normal, distortos_Mutex_Protocol_none, 0)
 C-API equivalent of distortos::Mutex's constructor, type = distortos_Mutex_Type_normal, protocol = distortos_Mutex_Protocol_none, priorityCeiling = 0. More...
 

Enumerations

enum  { distortos_Mutex_Protocol_none, distortos_Mutex_Protocol_priorityInheritance, distortos_Mutex_Protocol_priorityProtect }
 
enum  { distortos_Mutex_Type_normal, distortos_Mutex_Type_errorChecking, distortos_Mutex_Type_recursive }
 
enum  { distortos_Mutex_typeShift = 0 }
 
enum  { distortos_Mutex_protocolShift = 4 }
 

Functions

int distortos_Mutex_construct_3 (struct distortos_Mutex *mutex, uint8_t type, uint8_t protocol, uint8_t priorityCeiling)
 C-API equivalent of distortos::Mutex's constructor. More...
 
static int distortos_Mutex_construct_2pc (struct distortos_Mutex *const mutex, const uint8_t protocol, const uint8_t priorityCeiling)
 C-API equivalent of distortos::Mutex's constructor, type = distortos_Mutex_Type_normal. More...
 
static int distortos_Mutex_construct_2tp (struct distortos_Mutex *const mutex, const uint8_t type, const uint8_t protocol)
 C-API equivalent of distortos::Mutex's constructor, priorityCeiling = 0. More...
 
static int distortos_Mutex_construct_1p (struct distortos_Mutex *const mutex, const uint8_t protocol)
 C-API equivalent of distortos::Mutex's constructor, type = distortos_Mutex_Type_normal, priorityCeiling = 0. More...
 
static int distortos_Mutex_construct_1t (struct distortos_Mutex *const mutex, const uint8_t type)
 C-API equivalent of distortos::Mutex's constructor, protocol = distortos_Mutex_Protocol_none, priorityCeiling = 0. More...
 
static int distortos_Mutex_construct (struct distortos_Mutex *const mutex)
 C-API equivalent of distortos::Mutex's constructor, type = distortos_Mutex_Type_normal, protocol = distortos_Mutex_Protocol_none, priorityCeiling = 0. More...
 
int distortos_Mutex_destruct (struct distortos_Mutex *mutex)
 C-API equivalent of distortos::Mutex's destructor. More...
 
int distortos_Mutex_lock (struct distortos_Mutex *mutex)
 C-API equivalent of distortos::Mutex::lock() More...
 
int distortos_Mutex_tryLock (struct distortos_Mutex *mutex)
 C-API equivalent of distortos::Mutex::tryLock() More...
 
int distortos_Mutex_tryLockFor (struct distortos_Mutex *mutex, int64_t duration)
 C-API equivalent of distortos::Mutex::tryLockFor() More...
 
int distortos_Mutex_tryLockUntil (struct distortos_Mutex *mutex, int64_t timePoint)
 C-API equivalent of distortos::Mutex::tryLockUntil() More...
 
int distortos_Mutex_unlock (struct distortos_Mutex *mutex)
 C-API equivalent of distortos::Mutex::unlock() More...
 

Detailed Description

Header of C-API for distortos::Mutex.

Author
Copyright (C) 2017-2018 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info
License
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.