diff options
| author | luigi1111 <luigi1111w@gmail.com> | 2020-10-13 12:38:40 -0500 |
|---|---|---|
| committer | luigi1111 <luigi1111w@gmail.com> | 2020-10-13 12:38:40 -0500 |
| commit | 381442a1386c1319034c1335f01040da2306dd31 (patch) | |
| tree | f507d6fc8a3de36ee12c4439ad2d68d8eb62e5ba /src/qt | |
| parent | 7cb24f50b8676748212e57017b043ba1e7b08033 (diff) | |
| parent | 39d9d7d071dd9ed7a942578a7db520ac0ec08f5e (diff) | |
| download | monzero-gui-381442a1386c1319034c1335f01040da2306dd31.tar.gz monzero-gui-381442a1386c1319034c1335f01040da2306dd31.tar.xz monzero-gui-381442a1386c1319034c1335f01040da2306dd31.zip | |
Merge pull request #3145
39d9d7d Wallet: rework wallet refreshing (xiphon)
Diffstat (limited to 'src/qt')
| -rw-r--r-- | src/qt/FutureScheduler.cpp | 5 | ||||
| -rw-r--r-- | src/qt/FutureScheduler.h | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/qt/FutureScheduler.cpp b/src/qt/FutureScheduler.cpp index b15101e4..f83b5e7f 100644 --- a/src/qt/FutureScheduler.cpp +++ b/src/qt/FutureScheduler.cpp @@ -65,6 +65,11 @@ QPair<bool, QFuture<QJSValueList>> FutureScheduler::run(std::function<QJSValueLi }); } +bool FutureScheduler::stopping() const noexcept +{ + return Stopping; +} + bool FutureScheduler::add() noexcept { QMutexLocker locker(&Mutex); diff --git a/src/qt/FutureScheduler.h b/src/qt/FutureScheduler.h index ab9f323d..b5905956 100644 --- a/src/qt/FutureScheduler.h +++ b/src/qt/FutureScheduler.h @@ -23,6 +23,7 @@ public: QPair<bool, QFuture<void>> run(std::function<void()> function) noexcept; QPair<bool, QFuture<QJSValueList>> run(std::function<QJSValueList()> function, const QJSValue &callback); + bool stopping() const noexcept; private: bool add() noexcept; @@ -59,7 +60,7 @@ private: size_t Alive; QWaitCondition Condition; QMutex Mutex; - bool Stopping; + std::atomic<bool> Stopping; }; #endif // FUTURE_SCHEDULER_H |
