MCPcopy Create free account
hub / github.com/WaykiChain/WaykiChain / RunCoin

Function RunCoin

src/coind.cpp:124–144  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122 return fRet;
123}
124std::tuple<bool, boost::thread*> RunCoin(int argc, char* argv[]) {
125 boost::thread* detectShutdownThread = nullptr;
126 static boost::thread_group threadGroup;
127 SetupEnvironment();
128
129 bool fRet = AppInit(argc, argv, threadGroup);
130
131 detectShutdownThread = new boost::thread(boost::bind(&DetectShutdownThread, &threadGroup));
132
133 if (!fRet) {
134 if (detectShutdownThread)
135 detectShutdownThread->interrupt();
136 Interrupt();
137 threadGroup.interrupt_all();
138
139 // threadGroup.join_all(); was left out intentionally here, because we didn't re-test all of
140 // the startup-failure cases to make sure they don't result in a hang due to some
141 // thread-blocking-waiting-for-another-thread-during-startup case
142 }
143 return std::make_tuple(fRet, detectShutdownThread);
144}
145
146int main(int argc, char* argv[]) {
147 std::tuple<bool, boost::thread*> ret = RunCoin(argc, argv);

Callers 1

mainFunction · 0.70

Calls 3

SetupEnvironmentFunction · 0.85
InterruptFunction · 0.85
AppInitFunction · 0.70

Tested by

no test coverage detected