https://github.com/bitcoin/bitcoin/blob/master/src/bitcoind.cpp#L188
Lol. I couldn't help laugh a little .
You can also jump to AppInitMain() in the "init.cpp" file. Here are some notes I took once when walking through the code:
- Creates the service queue thread (CScheduler::serviceQueue()) which runs "forever" until interrupted and adds it
to the "threadGroup" (a boost::thread_group which was created in AppInit() in bitcoind.cpp)
- Inside serviceQueue(), it's a big while-loop, which essentially dequeues and calls the next task in the queue:
Function f = taskQueue.begin()->second; // "second" is like the 2nd thing in a tuple, which is a function call.
// .. other stuff
f(); // call the actual function