91ccd16b33
This makes the initialization sequence much cleaner and conceptually well encapsulated. We also now dynamically allocate the Mind objects. They're allocated dynamically by Mrntt inside of initializeReq. This means that we no longer have to worry about jolting and cleaning up the running threads of global mind object even when we never explicitly called Mind.initializeReq. Along with other conceptual improvements to our abstractions, this patch also gets us to a real "end of program initialization" point for the first time.
28 lines
757 B
C++
28 lines
757 B
C++
#include <iostream>
|
|
#include <componentThread.h>
|
|
#include <marionette/marionette.h>
|
|
|
|
|
|
int main(int argc, char *argv[], char *envp[])
|
|
{
|
|
/* We don't do anything inside of main()
|
|
* Main merely waits for the marionette thread to exit.
|
|
*/
|
|
std::cout << "CRT:" << __func__ << ": about to JOLT Mrntt with cmdline args"
|
|
<< '\n';
|
|
smo::mrntt::thread->getIoService().post(
|
|
[argc, argv, envp]()
|
|
{
|
|
std::cout << "Mrntt:" << __func__ << ":JOLTED: setting cmdline args"
|
|
<< '\n';
|
|
smo::CrtCommandLineArgs::set(argc, argv, envp);
|
|
smo::mrntt::thread->getIoService().stop();
|
|
}
|
|
);
|
|
|
|
smo::mrntt::thread->thread.join();
|
|
std::cout << "CRT:" << __func__ << ": Mrntt exited with code '"
|
|
<< smo::mrntt::exitCode << "'\n";
|
|
return smo::mrntt::exitCode;
|
|
}
|