1#ifndef QX_THREAD_SAFE_SINGLETON_H
2#define QX_THREAD_SAFE_SINGLETON_H
6#include <QRecursiveMutex>
9#include "qx/core/qx-exclusiveaccess.h"
17template<
class Singleton,
typename Mutex = QMutex>
18 requires any_of<Mutex, QMutex, QRecursiveMutex>
24 static inline constinit Mutex smMutex;
43#define QX_THREAD_SAFE_SINGLETON(...) friend ThreadSafeSingleton<__VA_ARGS__>
The ExclusiveAccess template class is a convenience class that simplifies access to resources secured...
Definition qx-exclusiveaccess.h:16
The ThreadSafeSingleton template class provides access to a static singleton instance in a thread-saf...
Definition qx-threadsafesingleton.h:20
static Qx::ExclusiveAccess< Singleton, QMutex > instance()
Definition qx-threadsafesingleton.h:32
ThreadSafeSingleton()=default
The Qx namespace is the main namespace through which all non-global functionality of the Qx library i...
Definition qx-abstracterror.cpp:13
The qx-concepts header file provides a library of general purpose concepts as an extension of the sta...