diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-03-13 06:57:07 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2017-03-13 06:57:24 +0100 |
commit | f8a709161f3710fe62e05988a9101933944489fb (patch) | |
tree | 3a114d8850c31bb7873cd04d8b0b93f209dea198 /src | |
parent | 7e58b41bd7ce2714db1c7b1ca5b2708ff40b478a (diff) | |
parent | 819b513a5415d1669b5440e214862cda6c2261f8 (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/net.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/net.cpp b/src/net.cpp index 6ff63d4730..4434793c4c 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2319,9 +2319,17 @@ void CConnman::Interrupt() interruptNet(); InterruptSocks5(true); - if (semOutbound) - for (int i=0; i<(nMaxOutbound + nMaxFeeler); i++) + if (semOutbound) { + for (int i=0; i<(nMaxOutbound + nMaxFeeler); i++) { semOutbound->post(); + } + } + + if (semAddnode) { + for (int i=0; i<nMaxAddnode; i++) { + semAddnode->post(); + } + } } void CConnman::Stop() @@ -2337,10 +2345,6 @@ void CConnman::Stop() if (threadSocketHandler.joinable()) threadSocketHandler.join(); - if (semAddnode) - for (int i=0; i<nMaxAddnode; i++) - semOutbound->post(); - if (fAddressesInitialized) { DumpData(); |