diff options
| author | xiphon <xiphon@protonmail.com> | 2020-10-09 12:04:53 +0000 |
|---|---|---|
| committer | xiphon <xiphon@protonmail.com> | 2020-10-09 14:11:05 +0000 |
| commit | 39d9d7d071dd9ed7a942578a7db520ac0ec08f5e (patch) | |
| tree | ce1d65d44cddca4e5860fcb08a0f1a7ff0ff56fd /src/qt | |
| parent | d3943ca2a9e1fa27ec9141ed94e1d4fb530aca31 (diff) | |
| download | monzero-gui-39d9d7d071dd9ed7a942578a7db520ac0ec08f5e.tar.gz monzero-gui-39d9d7d071dd9ed7a942578a7db520ac0ec08f5e.tar.xz monzero-gui-39d9d7d071dd9ed7a942578a7db520ac0ec08f5e.zip | |
Wallet: rework wallet refreshing
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 |
