diff options
-rw-r--r-- | qtools/qshared.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/qtools/qshared.h b/qtools/qshared.h index 79fab7b..58ad6fc 100644 --- a/qtools/qshared.h +++ b/qtools/qshared.h @@ -1,5 +1,5 @@ /**************************************************************************** -** +** ** ** Definition of QShared struct ** @@ -42,13 +42,15 @@ #include "qglobal.h" #endif // QT_H +#include <atomic> + struct QShared { - QShared() { count = 1; } + QShared() : count(1) { } void ref() { count++; } bool deref() { return !--count; } - uint count; + std::atomic_uint count; }; |