Skip to content

Commit 5cb0da4

Browse files
jkbonfielddaviesrob
authored andcommitted
Fixes a multi-threading cram decode bug.
It sometimes failed to set the EOF flag correctly, reporting decode failures instead of terminating correctly. Fixes #734 (Error with cram queries and multiple threads).
1 parent 2050db4 commit 5cb0da4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cram/cram_decode.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3212,8 +3212,10 @@ static cram_slice *cram_next_slice(cram_fd *fd, cram_container **cp) {
32123212
hts_tpool_result *res;
32133213
cram_decode_job *j;
32143214

3215-
if (fd->ooc && hts_tpool_process_empty(fd->rqueue))
3215+
if (fd->ooc && hts_tpool_process_empty(fd->rqueue)) {
3216+
fd->eof = 1;
32163217
return NULL;
3218+
}
32173219

32183220
res = hts_tpool_next_result_wait(fd->rqueue);
32193221

0 commit comments

Comments
 (0)