summaryrefslogtreecommitdiffstats
path: root/qtools
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2020-06-14 15:00:10 (GMT)
committerDimitri van Heesch <doxygen@gmail.com>2020-06-14 15:00:10 (GMT)
commit3040df2f0aa29a4207de5b37da1d20e3d27340bb (patch)
treead59b1b1018db4d498e9558f4d141cb29e8bdacd /qtools
parent12515664fe30dd79f48fca4b1e3d6cdd3c1a5ce1 (diff)
downloadDoxygen-3040df2f0aa29a4207de5b37da1d20e3d27340bb.zip
Doxygen-3040df2f0aa29a4207de5b37da1d20e3d27340bb.tar.gz
Doxygen-3040df2f0aa29a4207de5b37da1d20e3d27340bb.tar.bz2
Added atomic reference counting to QString
Diffstat (limited to 'qtools')
-rw-r--r--qtools/qshared.h8
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;
};