Simplified XF 1.1.0
mutex.h
1#ifndef XF_INTERFACE_MUTEX_H
2#define XF_INTERFACE_MUTEX_H
3
4#include <stdint.h>
5
6namespace interface {
7
18{
19public:
20 virtual ~XFMutex() = default;
21
22 virtual void lock() = 0;
23 virtual void unlock() = 0;
24
32 virtual bool tryLock(int32_t timeout = 0) = 0;
33
49 static XFMutex * create();
50
51protected:
52 XFMutex() = default;
53};
54
55} // namespace interface
56#endif // XF_INTERFACE_MUTEX_H
Mutex interface needed by the XF to access a mutex.
Definition: mutex.h:18
virtual void unlock()=0
Releases the mutex so it can be taken by other threads.
virtual void lock()=0
Blocks until the mutex becomes available.
static XFMutex * create()
Creates and returns a new mutex instance.
Definition: mutex.cpp:11
virtual bool tryLock(int32_t timeout=0)=0
Tries to get the mutex.