mutex.h
#ifndef XF_INTERFACE_MUTEX_H
#define XF_INTERFACE_MUTEX_H
#include <stdint.h>
namespace interface {
class XFMutex
{
public:
virtual ~XFMutex() = default;
virtual void lock() = 0;
virtual void unlock() = 0;
virtual bool tryLock(int32_t timeout = 0) = 0;
static XFMutex * create();
protected:
XFMutex() = default;
};
} // namespace interface
#endif // XF_INTERFACE_MUTEX_H
interface::XFMutex
Mutex interface needed by the XF to access a mutex.
Definition: mutex.h:18
interface::XFMutex::unlock
virtual void unlock()=0
Releases the mutex so it can be taken by other threads.
interface::XFMutex::lock
virtual void lock()=0
Blocks until the mutex becomes available.
interface::XFMutex::create
static XFMutex * create()
Creates and returns a new mutex instance.
Definition: mutex.cpp:11
interface::XFMutex::tryLock
virtual bool tryLock(int32_t timeout=0)=0
Tries to get the mutex.