refactor
This commit is contained in:
parent
d2928e5580
commit
f260f1d50a
@ -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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user