distortos
v0.7.0
object-oriented C++ RTOS for microcontrollers
|
Mutex-related C-API of distortos. More...
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... | |
Mutex-related C-API of distortos.
#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.
[in] | name | is the name of the object that will be instantiated |
#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.
[in] | name | is the name of the object that will be instantiated |
[in] | protocol | is the mutex protocol, {distortos_Mutex_Protocol_none, distortos_Mutex_Protocol_priorityInheritance, distortos_Mutex_Protocol_priorityProtect} |
#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.
[in] | name | is the name of the object that will be instantiated |
[in] | type | is the type of mutex, {distortos_Mutex_Type_normal, distortos_Mutex_Type_errorChecking, distortos_Mutex_Type_recursive} |
#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.
[in] | name | is the name of the object that will be instantiated |
[in] | protocol | is the mutex protocol, {distortos_Mutex_Protocol_none, distortos_Mutex_Protocol_priorityInheritance, distortos_Mutex_Protocol_priorityProtect} |
[in] | priorityCeiling | is the priority ceiling of mutex, ignored when protocol != distortos_Mutex_Protocol_priorityProtect |
#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.
[in] | name | is the name of the object that will be instantiated |
[in] | type | is the type of mutex, {distortos_Mutex_Type_normal, distortos_Mutex_Type_errorChecking, distortos_Mutex_Type_recursive} |
[in] | protocol | is the mutex protocol, {distortos_Mutex_Protocol_none, distortos_Mutex_Protocol_priorityInheritance, distortos_Mutex_Protocol_priorityProtect} |
#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.
[in] | name | is the name of the object that will be instantiated |
[in] | type | is the type of mutex, {distortos_Mutex_Type_normal, distortos_Mutex_Type_errorChecking, distortos_Mutex_Type_recursive} |
[in] | protocol | is the mutex protocol, {distortos_Mutex_Protocol_none, distortos_Mutex_Protocol_priorityInheritance, distortos_Mutex_Protocol_priorityProtect} |
[in] | priorityCeiling | is the priority ceiling of mutex, ignored when protocol != distortos_Mutex_Protocol_priorityProtect |
#define DISTORTOS_MUTEX_INITIALIZER | ( | self, | |
type, | |||
protocol, | |||
priorityCeiling | |||
) |
Initializer for distortos_Mutex.
[in] | self | is an equivalent of this hidden argument |
[in] | type | is the type of mutex, {distortos_Mutex_Type_normal, distortos_Mutex_Type_errorChecking, distortos_Mutex_Type_recursive} |
[in] | protocol | is the mutex protocol, {distortos_Mutex_Protocol_none, distortos_Mutex_Protocol_priorityInheritance, distortos_Mutex_Protocol_priorityProtect} |
[in] | priorityCeiling | is the priority ceiling of mutex, ignored when protocol != distortos_Mutex_Protocol_priorityProtect |
anonymous enum |
anonymous enum |
|
inlinestatic |
C-API equivalent of distortos::Mutex's constructor, type = distortos_Mutex_Type_normal, protocol = distortos_Mutex_Protocol_none, priorityCeiling = 0.
Similar to std::mutex::mutex() - http://en.cppreference.com/w/cpp/thread/mutex/mutex Similar to pthread_mutex_init() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_init.html
[in] | mutex | is a pointer to distortos_Mutex object |
|
inlinestatic |
C-API equivalent of distortos::Mutex's constructor, type = distortos_Mutex_Type_normal, priorityCeiling = 0.
Similar to std::mutex::mutex() - http://en.cppreference.com/w/cpp/thread/mutex/mutex Similar to pthread_mutex_init() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_init.html
[in] | mutex | is a pointer to distortos_Mutex object |
[in] | protocol | is the mutex protocol, {distortos_Mutex_Protocol_none, distortos_Mutex_Protocol_priorityInheritance, distortos_Mutex_Protocol_priorityProtect} |
|
inlinestatic |
C-API equivalent of distortos::Mutex's constructor, protocol = distortos_Mutex_Protocol_none, priorityCeiling = 0.
Similar to std::mutex::mutex() - http://en.cppreference.com/w/cpp/thread/mutex/mutex Similar to pthread_mutex_init() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_init.html
[in] | mutex | is a pointer to distortos_Mutex object |
[in] | type | is the type of mutex, {distortos_Mutex_Type_normal, distortos_Mutex_Type_errorChecking, distortos_Mutex_Type_recursive} |
|
inlinestatic |
C-API equivalent of distortos::Mutex's constructor, type = distortos_Mutex_Type_normal.
Similar to std::mutex::mutex() - http://en.cppreference.com/w/cpp/thread/mutex/mutex Similar to pthread_mutex_init() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_init.html
[in] | mutex | is a pointer to distortos_Mutex object |
[in] | protocol | is the mutex protocol, {distortos_Mutex_Protocol_none, distortos_Mutex_Protocol_priorityInheritance, distortos_Mutex_Protocol_priorityProtect} |
[in] | priorityCeiling | is the priority ceiling of mutex, ignored when protocol != distortos_Mutex_Protocol_priorityProtect |
|
inlinestatic |
C-API equivalent of distortos::Mutex's constructor, priorityCeiling = 0.
Similar to std::mutex::mutex() - http://en.cppreference.com/w/cpp/thread/mutex/mutex Similar to pthread_mutex_init() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_init.html
[in] | mutex | is a pointer to distortos_Mutex object |
[in] | type | is the type of mutex, {distortos_Mutex_Type_normal, distortos_Mutex_Type_errorChecking, distortos_Mutex_Type_recursive} |
[in] | protocol | is the mutex protocol, {distortos_Mutex_Protocol_none, distortos_Mutex_Protocol_priorityInheritance, distortos_Mutex_Protocol_priorityProtect} |
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.
Similar to std::mutex::mutex() - http://en.cppreference.com/w/cpp/thread/mutex/mutex Similar to pthread_mutex_init() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_init.html
[in] | mutex | is a pointer to distortos_Mutex object |
[in] | type | is the type of mutex, {distortos_Mutex_Type_normal, distortos_Mutex_Type_errorChecking, distortos_Mutex_Type_recursive} |
[in] | protocol | is the mutex protocol, {distortos_Mutex_Protocol_none, distortos_Mutex_Protocol_priorityInheritance, distortos_Mutex_Protocol_priorityProtect} |
[in] | priorityCeiling | is the priority ceiling of mutex, ignored when protocol != distortos_Mutex_Protocol_priorityProtect |
int distortos_Mutex_destruct | ( | struct distortos_Mutex * | mutex | ) |
C-API equivalent of distortos::Mutex's destructor.
Similar to std::mutex::~mutex() - http://en.cppreference.com/w/cpp/thread/mutex/~mutex Similar to pthread_mutex_destroy() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_destroy.html
[in] | mutex | is a pointer to distortos_Mutex object |
int distortos_Mutex_lock | ( | struct distortos_Mutex * | mutex | ) |
C-API equivalent of distortos::Mutex::lock()
Similar to std::mutex::lock() - http://en.cppreference.com/w/cpp/thread/mutex/lock Similar to pthread_mutex_lock() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_lock.html#
[in] | mutex | is a pointer to distortos_Mutex object |
int distortos_Mutex_tryLock | ( | struct distortos_Mutex * | mutex | ) |
C-API equivalent of distortos::Mutex::tryLock()
Similar to std::mutex::try_lock() - http://en.cppreference.com/w/cpp/thread/mutex/try_lock Similar to pthread_mutex_trylock() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_lock.html#
[in] | mutex | is a pointer to distortos_Mutex object |
int distortos_Mutex_tryLockFor | ( | struct distortos_Mutex * | mutex, |
int64_t | duration | ||
) |
C-API equivalent of distortos::Mutex::tryLockFor()
Similar to std::timed_mutex::try_lock_for() - http://en.cppreference.com/w/cpp/thread/timed_mutex/try_lock_for Similar to pthread_mutex_timedlock() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_timedlock.html#
[in] | mutex | is a pointer to distortos_Mutex object |
[in] | duration | is the duration in system ticks after which the wait will be terminated without locking the mutex |
int distortos_Mutex_tryLockUntil | ( | struct distortos_Mutex * | mutex, |
int64_t | timePoint | ||
) |
C-API equivalent of distortos::Mutex::tryLockUntil()
Similar to std::timed_mutex::try_lock_until() - http://en.cppreference.com/w/cpp/thread/timed_mutex/try_lock_until Similar to pthread_mutex_timedlock() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_timedlock.html#
[in] | mutex | is a pointer to distortos_Mutex object |
[in] | timePoint | is the time point in system ticks at which the wait will be terminated without locking the mutex |
int distortos_Mutex_unlock | ( | struct distortos_Mutex * | mutex | ) |
C-API equivalent of distortos::Mutex::unlock()
Similar to std::mutex::unlock() - http://en.cppreference.com/w/cpp/thread/mutex/unlock Similar to pthread_mutex_unlock() - http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_mutex_lock.html#
[in] | mutex | is a pointer to distortos_Mutex object |