Skip to content

Commit

Permalink
Updated async runner to latest patch
Browse files Browse the repository at this point in the history
  • Loading branch information
d-cameron committed Mar 8, 2019
1 parent 8f2109e commit 9ea5ecf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/htsjdk/samtools/util/AsyncReadTaskRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,11 @@ private Deque<RecordOrException<U>> readNextBatch() {
Tuple<U, Long> ra;
try {
ra = performReadAhead(mBatchBufferBudget - bufferConsumed);
if (ra.a == null) {
if (ra == null || ra.a == null) {
eosReached = true;
}
batch.addLast(new RecordOrException(ra.a));
if (ra.b == 0 || ra.b == null) {
batch.addLast(new RecordOrException(ra == null ? null : ra.a));
if (ra == null || ra.b == 0 || ra.b == null) {
// performReadAhead() keeps returning 0 to us, we'll never exit
break; // safety exit to ensure we are guaranteed to finish the batch
}
Expand Down

0 comments on commit 9ea5ecf

Please sign in to comment.