indexer: fix some threading issues with Progress

Make it a const object with atomic members.
This commit is contained in:
Dirk-Jan C. Binnema
2022-02-07 20:49:43 +02:00
parent a628f214a1
commit 18ddbe06e6
2 changed files with 16 additions and 9 deletions

View File

@ -284,7 +284,7 @@ Indexer::Private::cleanup()
void
Indexer::Private::scan_worker()
{
progress_ = {};
progress_.reset();
if (conf_.scan) {
g_debug("starting scanner");
@ -410,7 +410,7 @@ Indexer::is_running() const
return priv_->state_ != IndexState::Idle;
}
Indexer::Progress
const Indexer::Progress&
Indexer::progress() const
{
priv_->progress_.running = priv_->state_ == IndexState::Idle ? false : true;