Changeset View
Changeset View
Standalone View
Standalone View
src/init.cpp
Show First 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | |||||
#include <validation.h> | #include <validation.h> | ||||
#include <validationinterface.h> | #include <validationinterface.h> | ||||
#include <walletinitinterface.h> | #include <walletinitinterface.h> | ||||
#include <warnings.h> | #include <warnings.h> | ||||
#include <boost/algorithm/string/classification.hpp> | #include <boost/algorithm/string/classification.hpp> | ||||
#include <boost/algorithm/string/replace.hpp> | #include <boost/algorithm/string/replace.hpp> | ||||
#include <boost/algorithm/string/split.hpp> | #include <boost/algorithm/string/split.hpp> | ||||
#include <boost/bind.hpp> | |||||
#include <boost/interprocess/sync/file_lock.hpp> | #include <boost/interprocess/sync/file_lock.hpp> | ||||
#include <boost/thread.hpp> | #include <boost/thread.hpp> | ||||
#if ENABLE_ZMQ | #if ENABLE_ZMQ | ||||
#include <zmq/zmqnotificationinterface.h> | #include <zmq/zmqnotificationinterface.h> | ||||
#endif | #endif | ||||
#ifndef WIN32 | #ifndef WIN32 | ||||
▲ Show 20 Lines • Show All 1,836 Lines • ▼ Show 20 Lines | #endif | ||||
if (nScriptCheckThreads) { | if (nScriptCheckThreads) { | ||||
for (int i = 0; i < nScriptCheckThreads - 1; i++) { | for (int i = 0; i < nScriptCheckThreads - 1; i++) { | ||||
threadGroup.create_thread(&ThreadScriptCheck); | threadGroup.create_thread(&ThreadScriptCheck); | ||||
} | } | ||||
} | } | ||||
// Start the lightweight task scheduler thread | // Start the lightweight task scheduler thread | ||||
CScheduler::Function serviceLoop = | CScheduler::Function serviceLoop = | ||||
boost::bind(&CScheduler::serviceQueue, &scheduler); | std::bind(&CScheduler::serviceQueue, &scheduler); | ||||
threadGroup.create_thread(boost::bind(&TraceThread<CScheduler::Function>, | threadGroup.create_thread(std::bind(&TraceThread<CScheduler::Function>, | ||||
"scheduler", serviceLoop)); | "scheduler", serviceLoop)); | ||||
GetMainSignals().RegisterBackgroundSignalScheduler(scheduler); | GetMainSignals().RegisterBackgroundSignalScheduler(scheduler); | ||||
GetMainSignals().RegisterWithMempoolSignals(g_mempool); | GetMainSignals().RegisterWithMempoolSignals(g_mempool); | ||||
/** | /** | ||||
* Register RPC commands regardless of -server setting so they will be | * Register RPC commands regardless of -server setting so they will be | ||||
* available in the GUI RPC console even if external calls are disabled. | * available in the GUI RPC console even if external calls are disabled. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 467 Lines • ▼ Show 20 Lines | #endif | ||||
} | } | ||||
std::vector<fs::path> vImportFiles; | std::vector<fs::path> vImportFiles; | ||||
for (const std::string &strFile : gArgs.GetArgs("-loadblock")) { | for (const std::string &strFile : gArgs.GetArgs("-loadblock")) { | ||||
vImportFiles.push_back(strFile); | vImportFiles.push_back(strFile); | ||||
} | } | ||||
threadGroup.create_thread( | threadGroup.create_thread( | ||||
boost::bind(&ThreadImport, std::ref(config), vImportFiles)); | std::bind(&ThreadImport, std::ref(config), vImportFiles)); | ||||
// Wait for genesis block to be processed | // Wait for genesis block to be processed | ||||
{ | { | ||||
WAIT_LOCK(g_genesis_wait_mutex, lock); | WAIT_LOCK(g_genesis_wait_mutex, lock); | ||||
// We previously could hang here if StartShutdown() is called prior to | // We previously could hang here if StartShutdown() is called prior to | ||||
// ThreadImport getting started, so instead we just wait on a timer to | // ThreadImport getting started, so instead we just wait on a timer to | ||||
// check ShutdownRequested() regularly. | // check ShutdownRequested() regularly. | ||||
while (!fHaveGenesis && !ShutdownRequested()) { | while (!fHaveGenesis && !ShutdownRequested()) { | ||||
▲ Show 20 Lines • Show All 112 Lines • Show Last 20 Lines |