Create a scheduler thread for lightweight tasks

This commit is contained in:
Gavin Andresen
2015-04-03 11:50:06 -04:00
parent 68d370bec4
commit ddd0acd3db
4 changed files with 14 additions and 4 deletions

View File

@@ -26,6 +26,7 @@
#include "init.h"
#include "main.h"
#include "rpcserver.h"
#include "scheduler.h"
#include "ui_interface.h"
#include "util.h"
@@ -178,6 +179,7 @@ signals:
private:
boost::thread_group threadGroup;
CScheduler scheduler;
/// Pass fatal exception message to UI thread
void handleRunawayException(const std::exception *e);
@@ -258,7 +260,7 @@ void BitcoinCore::initialize()
try
{
qDebug() << __func__ << ": Running AppInit2 in thread";
int rv = AppInit2(threadGroup);
int rv = AppInit2(threadGroup, scheduler);
if(rv)
{
/* Start a dummy RPC thread if no RPC thread is active yet