Simplified XF 1.1.0
mutex.h
1#ifndef XF_MUTEX_DEFAULT_QT_H
2#define XF_MUTEX_DEFAULT_QT_H
3
4#include <config/xf-config.h>
5
6#if (USE_XF_IDF_QT_MUTEX_CLASS != 0)
7
8#include <stdint.h>
9#include <QMutex>
10#include "xf/interface/mutex.h"
11
20{
21 friend class interface::XFMutex;
22public:
23
24 void lock() override;
25 void unlock() override;
26
27 bool tryLock(int32_t timeout = 0) override;
28
29protected:
30 XFMutex() = default;
31
32protected:
33 QMutex mutex_;
34};
35 // end of port_idf_qt group
37#endif // USE_XF_IDF_QT_MUTEX_CLASS
38#endif // XF_MUTEX_DEFAULT_QT_H
Default Qt implementation for the XFMutex interface.
Definition: mutex.h:20
void lock() override
Blocks until the mutex becomes available.
XFMutex()=default
Do not allow to directly create an object of this class. Call interface::XFMutex::create() instead.
QMutex mutex_
The real mutex.
Definition: mutex.h:33
bool tryLock(int32_t timeout=0) override
Tries to get the mutex.
void unlock() override
Releases the mutex so it can be taken by other threads.
Mutex interface needed by the XF to access a mutex.
Definition: mutex.h:18