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