This commit is contained in:
Scott E. Graves 2024-12-20 20:57:29 -06:00
parent d2928e5580
commit f260f1d50a

View File

@ -558,17 +558,18 @@ void open_file::update_background_reader(std::size_t read_chunk) {
}
io_thread_notify_.notify_all();
io_lock.unlock();
} else {
do {
next_chunk = read_chunk_ =
((read_chunk_ + 1U) >= read_state_.size()) ? 0U
: read_chunk_ + 1U;
} while ((next_chunk != 0U) && (active_downloads_.find(next_chunk) !=
active_downloads_.end()));
file_lock.unlock();
download_chunk(next_chunk, true, false);
continue;
}
do {
next_chunk = read_chunk_ = ((read_chunk_ + 1U) >= read_state_.size())
? 0U
: read_chunk_ + 1U;
} while ((next_chunk != 0U) && (active_downloads_.find(next_chunk) !=
active_downloads_.end()));
file_lock.unlock();
download_chunk(next_chunk, true, false);
}
});
}