Simplified XF 1.1.0

Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
XFMutex Class Reference
IDF Qt Port Classes | IDF STM32 Port Classes

Default Qt implementation for the XFMutex interface. More...

`#include <mutex.h>`

Inheritance diagram for XFMutex:
Collaboration diagram for XFMutex:

## Public Member Functions
void | lock () override
| Blocks until the mutex becomes available. More...
void | unlock () override
| Releases the mutex so it can be taken by other threads. More...
bool | tryLock (int32_t timeout=0) override
| Tries to get the mutex. More...
void | lock () override
| Blocks until the mutex becomes available. More...
void | unlock () override
| Releases the mutex so it can be taken by other threads. More...
bool | tryLock (int32_t timeout=0) override
| Tries to get the mutex. More...

## Protected Member Functions
| XFMutex ()=default
| Do not allow to directly create an object of this class. Call interface::XFMutex::create() instead.
| XFMutex ()=default
| Do not allow to directly create an object of this class. Call interface::XFMutex::create() instead.

## Protected Attributes
QMutex | mutex_
| The real mutex.

## Friends
class | interface::XFMutex
class | XFEventQueue

## Additional Inherited Members
Static Public Member Functions inherited from interface::XFMutex
static XFMutex * | create ()
| Creates and returns a new mutex instance. More...

## Detailed Description

Default Qt implementation for the XFMutex interface.

Default IDF implementation XFMutex interface.

This class uses `enterCritical()` and `exitCritical()` functions which must be provided by the platform. Therefore, this mutex implementation can be used in Embedded Systems without OS.

## Member Function Documentation

## ◆ lock() [1/2]

void XFMutex::lock | ( |  | ) |
| override virtual

Blocks until the mutex becomes available.

Implements interface::XFMutex.

## ◆ lock() [2/2]

void XFMutex::lock | ( |  | ) |
| override virtual

Blocks until the mutex becomes available.

Implements interface::XFMutex.

## ◆ tryLock() [1/2]

bool XFMutex::tryLock | ( | int32_t | timeout = `0` | ) |
| override virtual

Tries to get the mutex.

If timeout is 0 method will leave immediately and then the return parameter indicates it the mutex could be taken or not. Giving a negative value will block the thread until the mutex becomes available.

Implements interface::XFMutex.

## ◆ tryLock() [2/2]

bool XFMutex::tryLock | ( | int32_t | timeout = `0` | ) |
| override virtual

Tries to get the mutex.

If timeout is 0 method will leave immediately and then the return parameter indicates it the mutex could be taken or not. Giving a negative value will block the thread until the mutex becomes available.

Implements interface::XFMutex.

## ◆ unlock() [1/2]

void XFMutex::unlock | ( |  | ) |
| override virtual

Releases the mutex so it can be taken by other threads.

Implements interface::XFMutex.

## ◆ unlock() [2/2]

void XFMutex::unlock | ( |  | ) |
| override virtual

Releases the mutex so it can be taken by other threads.

Implements interface::XFMutex.

The documentation for this class was generated from the following files:

- C:/Users/thomas.sterren/Desktop/PTR_XF_Release/03-release/work/src/simplified/xf/port/idf-qt/mutex.h
- C:/Users/thomas.sterren/Desktop/PTR_XF_Release/03-release/work/src/simplified/xf/port/idf-stm32/mutex.h