aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlincubator.h
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2019-10-18 17:13:53 +0200
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2019-10-21 23:20:35 +0200
commita9bf6e652aa99784343c94b0181c9443205e2a82 (patch)
tree6ff4a5c358f1f1bd0523a66733c75c31ca4a3cc5 /src/qml/qml/qqmlincubator.h
parentfecfa43cfac329a5b50663cd04bb74bf5a63ca6f (diff)
QQmlIncubationController::incubateWhile: port to atomic<bool>
"volatile bool" does not guarantee synchronization, and as such, the documentation (and the intended use case, having another thread stopping incubation) are wrong. Add a different overload that takes a std::atomic<bool> as a replacement. Change-Id: I05e2d608385d075ef67989839d6c0a634da7a64b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmlincubator.h')
-rw-r--r--src/qml/qml/qqmlincubator.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlincubator.h b/src/qml/qml/qqmlincubator.h
index f075407e73..6e47ca2173 100644
--- a/src/qml/qml/qqmlincubator.h
+++ b/src/qml/qml/qqmlincubator.h
@@ -42,6 +42,7 @@
#include <QtQml/qtqmlglobal.h>
#include <QtQml/qqmlerror.h>
+#include <atomic>
QT_BEGIN_NAMESPACE
@@ -112,7 +113,11 @@ public:
int incubatingObjectCount() const;
void incubateFor(int msecs);
+#if QT_DEPRECATED_SINCE(5, 15)
+ QT_DEPRECATED_VERSION_X(5, 15, "Use the overload that takes a std::atomic<bool>")
void incubateWhile(volatile bool *flag, int msecs=0);
+#endif
+ void incubateWhile(std::atomic<bool> *flag, int msecs = 0);
protected:
virtual void incubatingObjectCountChanged(int);