diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2013-03-07 14:25:21 -0500 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2013-04-03 14:04:21 -0400 |
commit | 1b43bf0d3ae7b1fcde0c0e20c23c341540f4c8d2 (patch) | |
tree | ca5ce1b1cfaa0ac8bf6d6eb069a985fe685135e6 /src/init.cpp | |
parent | c8c2fbe07f1a5475aea3a2680af9130558c7e5c8 (diff) |
Rename util.h Sleep --> MilliSleep
Two reasons for this change:
1. Need to always use boost::thread's sleep, even on Windows, so the
sleeps can be interrupted (prior code used Windows' built-in Sleep).
2. I always forgot what units the old Sleep took.
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/init.cpp b/src/init.cpp index a5015adc48..d61bfa8921 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -43,7 +43,7 @@ enum BindFlags { void ExitTimeout(void* parg) { #ifdef WIN32 - Sleep(5000); + MilliSleep(5000); ExitProcess(0); #endif } @@ -105,7 +105,7 @@ void Shutdown(void* parg) UnregisterWallet(pwalletMain); delete pwalletMain; NewThread(ExitTimeout, NULL); - Sleep(50); + MilliSleep(50); printf("Bitcoin exited\n\n"); fExit = true; #ifndef QT_GUI @@ -116,8 +116,8 @@ void Shutdown(void* parg) else { while (!fExit) - Sleep(500); - Sleep(100); + MilliSleep(500); + MilliSleep(100); ExitThread(0); } } @@ -1061,7 +1061,7 @@ bool AppInit2(boost::thread_group& threadGroup) // Loop until process is exit()ed from shutdown() function, // called from ThreadRPCServer thread when a "stop" command is received. while (1) - Sleep(5000); + MilliSleep(5000); #endif return true; |