Skip to content

Commit f8a7091

Browse files
committed
Merge #9953: Fix shutdown hang with >= 8 -addnodes set
819b513 Add missing braces in semaphore posts in net (Matt Corallo) e007b24 Fix shutdown hang with >= 8 -addnodes set (Matt Corallo) Tree-SHA512: f2d7562bd5d333cd0e80562eb3b1fe329fc10ee713996e053d2ed669db6d9eb39550e0a6c6ab768cd070bfe92a5ea85e0f752470206706de196bd4a689b9bc07
2 parents 7e58b41 + 819b513 commit f8a7091

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

src/net.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2319,9 +2319,17 @@ void CConnman::Interrupt()
23192319
interruptNet();
23202320
InterruptSocks5(true);
23212321

2322-
if (semOutbound)
2323-
for (int i=0; i<(nMaxOutbound + nMaxFeeler); i++)
2322+
if (semOutbound) {
2323+
for (int i=0; i<(nMaxOutbound + nMaxFeeler); i++) {
23242324
semOutbound->post();
2325+
}
2326+
}
2327+
2328+
if (semAddnode) {
2329+
for (int i=0; i<nMaxAddnode; i++) {
2330+
semAddnode->post();
2331+
}
2332+
}
23252333
}
23262334

23272335
void CConnman::Stop()
@@ -2337,10 +2345,6 @@ void CConnman::Stop()
23372345
if (threadSocketHandler.joinable())
23382346
threadSocketHandler.join();
23392347

2340-
if (semAddnode)
2341-
for (int i=0; i<nMaxAddnode; i++)
2342-
semOutbound->post();
2343-
23442348
if (fAddressesInitialized)
23452349
{
23462350
DumpData();

0 commit comments

Comments
 (0)