Skip to content

Commit b225c1e

Browse files
committed
Fix segfault when iterating over the list pthreads to join
1 parent bc1b2cd commit b225c1e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ebwt_search.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,7 +1566,7 @@ static void exactSearch(PatternComposer& _patsrc,
15661566
SLEEP(10);
15671567
}
15681568
#else
1569-
for (int i = 0; i < nthreads; i++) {
1569+
for (int i = 0; i < nthreads - 1; i++) {
15701570
threads[i]->join();
15711571
}
15721572
#endif
@@ -1950,7 +1950,7 @@ static void mismatchSearchFull(PatternComposer& _patsrc,
19501950
SLEEP(10);
19511951
}
19521952
#else
1953-
for (int i = 0; i < nthreads; i++) {
1953+
for (int i = 0; i < nthreads - 1; i++) {
19541954
threads[i]->join();
19551955
}
19561956
#endif
@@ -2453,7 +2453,7 @@ static void twoOrThreeMismatchSearchFull(
24532453
SLEEP(10);
24542454
}
24552455
#else
2456-
for (int i = 0; i < nthreads; i++) {
2456+
for (int i = 0; i < nthreads - 1; i++) {
24572457
threads[i]->join();
24582458
}
24592459
#endif
@@ -3011,7 +3011,7 @@ static void seededQualCutoffSearchFull(
30113011
SLEEP(10);
30123012
}
30133013
#else
3014-
for (int i = 0; i < nthreads; i++) {
3014+
for (int i = 0; i < nthreads - 1; i++) {
30153015
threads[i]->join();
30163016
}
30173017
#endif

0 commit comments

Comments
 (0)