diff options
author | Dan Vrátil <dvratil@redhat.com> | 2015-02-20 15:11:46 +0100 |
---|---|---|
committer | Dan Vrátil <dvratil@redhat.com> | 2015-02-20 15:11:46 +0100 |
commit | d3dfcae4a7a182f55ce52fb5004ce08ca64db9a4 (patch) | |
tree | 7d448d60255f9d55020a245605e552306557e6b1 /async/src/future.h | |
parent | 8e6f41f851ae058dea63fbc9b9f523ec9fd1a4fb (diff) | |
download | sink-d3dfcae4a7a182f55ce52fb5004ce08ca64db9a4.tar.gz sink-d3dfcae4a7a182f55ce52fb5004ce08ca64db9a4.zip |
Async: only notify watchers once when Future::setFinished() is called multiple times
Diffstat (limited to 'async/src/future.h')
-rw-r--r-- | async/src/future.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/async/src/future.h b/async/src/future.h index 75669ba..b580b5a 100644 --- a/async/src/future.h +++ b/async/src/future.h | |||
@@ -57,6 +57,9 @@ class FutureGeneric : public FutureBase | |||
57 | public: | 57 | public: |
58 | void setFinished() | 58 | void setFinished() |
59 | { | 59 | { |
60 | if (d->finished) { | ||
61 | return; | ||
62 | } | ||
60 | d->finished = true; | 63 | d->finished = true; |
61 | for (auto watcher : d->watchers) { | 64 | for (auto watcher : d->watchers) { |
62 | if (watcher) { | 65 | if (watcher) { |