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
19 class XFMutex : public interface::XFMutex
20{
21 friend class interface::XFMutex;
22 public:
23
24 void lock() override;
25 void unlock() override;
26
27 bool tryLock(int32_t timeout = 0) override;
28
29 protected:
30 XFMutex() = default;
31
32 protected:
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
XFMutex
Default Qt implementation for the XFMutex interface.
Definition: mutex.h:20
XFMutex::lock
void lock() override
Blocks until the mutex becomes available.
XFMutex::XFMutex
XFMutex()=default
Do not allow to directly create an object of this class. Call interface::XFMutex::create() instead.
XFMutex::mutex_
QMutex mutex_
The real mutex.
Definition: mutex.h:33
XFMutex::tryLock
bool tryLock(int32_t timeout=0) override
Tries to get the mutex.
XFMutex::unlock
void unlock() override
Releases the mutex so it can be taken by other threads.
interface::XFMutex
Mutex interface needed by the XF to access a mutex.
Definition: mutex.h:18