diff options
| author | Pieter Wuille <[email protected]> | 2012-06-27 07:48:38 -0700 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2012-06-27 07:48:38 -0700 |
| commit | 4a52c187d342c27741d23b9536cb1a108f5a6fcb (patch) | |
| tree | d2df2d1907cfae32398821b54e5fe2edfed02411 /src/init.cpp | |
| parent | Merge pull request #1519 from Diapolo/GUI_locale_selection (diff) | |
| parent | On Windows link with `mswsock`, it being required (indirectly) by RPC code (diff) | |
| download | discoin-4a52c187d342c27741d23b9536cb1a108f5a6fcb.tar.xz discoin-4a52c187d342c27741d23b9536cb1a108f5a6fcb.zip | |
Merge pull request #457 from muggenhor/async-ipv6-rpc
IPv6 RPC using asynchronously accepted connections
Diffstat (limited to 'src/init.cpp')
| -rw-r--r-- | src/init.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/init.cpp b/src/init.cpp index f62c36c25..d136761db 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -9,6 +9,7 @@ #include "init.h" #include "util.h" #include "ui_interface.h" +#include <boost/bind.hpp> #include <boost/filesystem.hpp> #include <boost/filesystem/fstream.hpp> #include <boost/filesystem/convenience.hpp> @@ -40,13 +41,8 @@ void ExitTimeout(void* parg) void StartShutdown() { -#ifdef QT_GUI // ensure we leave the Qt main loop for a clean GUI exit (Shutdown() is called in bitcoin.cpp afterwards) uiInterface.QueueShutdown(); -#else - // Without UI, Shutdown() can simply be started in a new thread - CreateThread(Shutdown, NULL); -#endif } void Shutdown(void* parg) @@ -154,6 +150,11 @@ bool AppInit(int argc, char* argv[]) exit(ret); } + // Create the shutdown thread when receiving a shutdown signal + boost::signals2::scoped_connection do_stop( + uiInterface.QueueShutdown.connect(boost::bind( + &CreateThread, &Shutdown, static_cast<void*>(0), false))); + fRet = AppInit2(); } catch (std::exception& e) { |