Skip to content

Commit 50dbe3b

Browse files
committed
fixed thread id
1 parent b59b19f commit 50dbe3b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/querying.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,8 @@ void query_batched(
9999

100100
std::vector<std::thread> threads;
101101
// assign work to threads
102-
for(int i = 0; i < opt.numThreads; ++i) {
103-
threads.emplace_back([&] {
104-
const int threadId = i;
102+
for(int threadId = 0; threadId < opt.numThreads; ++threadId) {
103+
threads.emplace_back([&,threadId] {
105104
try {
106105
sequence_pair_reader reader{filename1, filename2};
107106

@@ -182,7 +181,7 @@ void query_batched(
182181
}
183182
}
184183
catch(file_access_error& e) {
185-
if(threadId == 1) {
184+
if(threadId == 0) {
186185
std::lock_guard<std::mutex> lock(exceptionMtx);
187186
log(std::string("FAIL: ") + e.what());
188187
}

0 commit comments

Comments
 (0)