Changeset View
Changeset View
Standalone View
Standalone View
src/qt/bitcoin.cpp
Show First 20 Lines • Show All 411 Lines • ▼ Show 20 Lines | void BitcoinApplication::startThread() { | ||||
// a reference around (even if it's non-const) you'll get Qt generating | // a reference around (even if it's non-const) you'll get Qt generating | ||||
// code to copy-construct the parameter in question (Q_DECLARE_METATYPE | // code to copy-construct the parameter in question (Q_DECLARE_METATYPE | ||||
// and qRegisterMetaType generate this code). For the Config class, | // and qRegisterMetaType generate this code). For the Config class, | ||||
// which is noncopyable, we can't do this. So.. we have to pass | // which is noncopyable, we can't do this. So.. we have to pass | ||||
// pointers to Config around. Make sure Config &/Config * isn't a | // pointers to Config around. Make sure Config &/Config * isn't a | ||||
// temporary (eg it lives somewhere aside from the stack) or this will | // temporary (eg it lives somewhere aside from the stack) or this will | ||||
// crash because initialize() gets executed in another thread at some | // crash because initialize() gets executed in another thread at some | ||||
// unspecified time (after) requestedInitialize() is emitted! | // unspecified time (after) requestedInitialize() is emitted! | ||||
connect(this, SIGNAL(requestedInitialize( | connect(this, | ||||
Config *, HTTPRPCRequestProcessor *, RPCServer *)), | SIGNAL(requestedInitialize(Config *, HTTPRPCRequestProcessor *, | ||||
RPCServer *)), | |||||
executor, SLOT(initialize(Config *, HTTPRPCRequestProcessor *))); | executor, SLOT(initialize(Config *, HTTPRPCRequestProcessor *))); | ||||
connect(this, SIGNAL(requestedShutdown()), executor, SLOT(shutdown())); | connect(this, SIGNAL(requestedShutdown()), executor, SLOT(shutdown())); | ||||
/* make sure executor object is deleted in its own thread */ | /* make sure executor object is deleted in its own thread */ | ||||
connect(this, SIGNAL(stopThread()), executor, SLOT(deleteLater())); | connect(this, SIGNAL(stopThread()), executor, SLOT(deleteLater())); | ||||
connect(this, SIGNAL(stopThread()), coreThread, SLOT(quit())); | connect(this, SIGNAL(stopThread()), coreThread, SLOT(quit())); | ||||
coreThread->start(); | coreThread->start(); | ||||
▲ Show 20 Lines • Show All 392 Lines • Show Last 20 Lines |