refactor
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good

This commit is contained in:
2024-12-28 13:55:25 -06:00
parent 9ae56c17a1
commit d6475a85d7

View File

@@ -663,6 +663,7 @@ void open_file::update_reader(std::size_t chunk) {
reader_thread_ = std::make_unique<std::thread>([this]() {
unique_recur_mutex_lock lock(rw_mtx_);
auto next_chunk{read_chunk_};
auto read_chunk{read_chunk_};
lock.unlock();
while (not stop_requested_) {
@@ -675,6 +676,10 @@ void open_file::update_reader(std::size_t chunk) {
continue;
}
if (read_chunk != read_chunk_) {
next_chunk = read_chunk = read_chunk_;
}
next_chunk = next_chunk + 1U >= read_state.size() ? 0U : next_chunk + 1U;
lock.unlock();