Skip to content

Commit f033c54

Browse files
fix: call join first
1 parent cc70203 commit f033c54

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/llmq/signing_shares.cpp

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -224,18 +224,17 @@ void CSigSharesManager::Stop()
224224
assert(false);
225225
}
226226

227-
// Stop worker pool
228-
workerPool.clear_queue();
229-
workerPool.stop(true);
230-
231-
// Join threads
227+
// Join threads FIRST to stop any pending push() calls
232228
if (housekeepingThread.joinable()) {
233229
housekeepingThread.join();
234230
}
235-
236231
if (dispatcherThread.joinable()) {
237232
dispatcherThread.join();
238233
}
234+
235+
// Then stop worker pool (now safe, no more push() calls)
236+
workerPool.clear_queue();
237+
workerPool.stop(true);
239238
}
240239

241240
void CSigSharesManager::RegisterAsRecoveredSigsListener()

0 commit comments

Comments
 (0)