aboutsummaryrefslogtreecommitdiff
path: root/net.cpp
diff options
context:
space:
mode:
authorGavin Andresen <[email protected]>2010-09-09 14:26:53 -0400
committerGavin Andresen <[email protected]>2010-09-09 14:26:53 -0400
commit90e165aa0c702a7efcbfc1e452e7f82dbd8411d0 (patch)
tree4a629be51e005a33f1547eecd04e0ea88cababa2 /net.cpp
parentMerge remote branch 'refs/remotes/svn/trunk' into svn (diff)
parenttry to auto-detect whether to use 128-bit 4-way SSE2 (diff)
downloaddiscoin-90e165aa0c702a7efcbfc1e452e7f82dbd8411d0.tar.xz
discoin-90e165aa0c702a7efcbfc1e452e7f82dbd8411d0.zip
Merge remote branch 'refs/remotes/svn/trunk' into svn
Diffstat (limited to 'net.cpp')
-rw-r--r--net.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/net.cpp b/net.cpp
index d1fdd241b..82b3ffb15 100644
--- a/net.cpp
+++ b/net.cpp
@@ -1160,9 +1160,13 @@ void ThreadMessageHandler2(void* parg)
pnode->Release();
}
- // Wait and allow messages to bunch up
+ // Wait and allow messages to bunch up.
+ // Reduce vnThreadsRunning so StopNode has permission to exit while
+ // we're sleeping, but we must always check fShutdown after doing this.
vnThreadsRunning[2]--;
Sleep(100);
+ if (fRequestShutdown)
+ Shutdown(NULL);
vnThreadsRunning[2]++;
if (fShutdown)
return;