diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-11-12 22:09:48 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-11-20 07:29:15 +0100 |
| commit | db4fde2e8983eaa0b76c49a189e059d6c9f5720d (patch) | |
| tree | d19f2cbd88fa4bb23a3a18213f24cf06964e1b75 /src/lib/job.h | |
| parent | 796ac1e76ff47b2e4dad2b3ef10458d8befac5d8 (diff) | |
Improve progress reporting of digest calculations (might help with #2643).
Diffstat (limited to 'src/lib/job.h')
| -rw-r--r-- | src/lib/job.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/job.h b/src/lib/job.h index dc5f7bc34..7814e0c2d 100644 --- a/src/lib/job.h +++ b/src/lib/job.h @@ -99,6 +99,8 @@ public: void when_finished(boost::signals2::connection& connection, std::function<void(Result)> finished); + void set_rate_limit_progress(bool rate_limit); + boost::signals2::signal<void()> Progress; /** Emitted from the UI thread when the job is finished */ boost::signals2::signal<void (Result)> Finished; @@ -159,6 +161,11 @@ private: boost::optional<float> _progress; boost::optional<struct timeval> _last_progress_update; + /** true to limit emissions of the progress signal so that they don't + * come too often. + */ + boost::atomic<bool> _rate_limit_progress; + /** condition to signal changes to pause/resume so that we know when to wake; this could be a general _state_change if it made more sense. */ |
