Skip to content

Commit

Permalink
Update reads.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
gf777 committed Dec 26, 2024
1 parent c059edc commit f30d128
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/reads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -739,13 +739,15 @@ void InReads::writeToStream() {

std::vector<std::pair<std::vector<InRead*>,uint32_t>> readBatchesCpy;

while (streamOutput || batchCounter-1 < readBatches.size()) {
while (streamOutput || batchCounter < readBatches.size()) {

{
std::unique_lock<std::mutex> lck(mtx);
writerMutexCondition.wait(lck, [this, batchCounter] {
return readBatches.size()>batchCounter;
});
if (!streamOutput || batchCounter == readBatches.size())
return;
readBatchesCpy = {readBatches.begin() + batchCounter, readBatches.end()};
}

Expand Down

0 comments on commit f30d128

Please sign in to comment.