2025-01-04 13:21:33 -04:00
|
|
|
#include <iostream>
|
2025-11-06 15:04:04 -04:00
|
|
|
#include <pthread.h>
|
2025-07-28 07:20:44 -04:00
|
|
|
#include <componentThread.h>
|
2025-12-26 01:18:39 -04:00
|
|
|
#include <spinscale/componentThread.h>
|
2026-02-22 17:46:27 -04:00
|
|
|
#include <spinscale/runtime.h>
|
|
|
|
|
#include <marionette/marionette.h>
|
2025-09-03 14:43:00 -04:00
|
|
|
|
2025-07-28 07:20:44 -04:00
|
|
|
int main(int argc, char *argv[], char *envp[])
|
2024-09-04 14:08:50 +10:00
|
|
|
{
|
2026-02-22 17:46:27 -04:00
|
|
|
/* Set the pptr thread ID and thread before using any ComponentThread
|
|
|
|
|
* functionality.
|
|
|
|
|
*/
|
|
|
|
|
sscl::ComponentThread::setPuppeteerThreadId(smo::SmoThreadId::MRNTT);
|
|
|
|
|
sscl::ComponentThread::setPuppeteerThread(smo::mrntt::thread);
|
2025-11-06 15:09:15 -04:00
|
|
|
pthread_setname_np(pthread_self(), "smo:CRT:main");
|
2025-07-28 07:20:44 -04:00
|
|
|
/* 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';
|
2026-02-22 17:46:27 -04:00
|
|
|
smo::mrntt::thread->getIoService().post(
|
2025-07-28 07:20:44 -04:00
|
|
|
[argc, argv, envp]()
|
2025-01-11 06:19:11 -04:00
|
|
|
{
|
2025-07-28 07:20:44 -04:00
|
|
|
std::cout << "Mrntt:" << __func__ << ":JOLTED: setting cmdline args"
|
|
|
|
|
<< '\n';
|
2025-12-28 03:44:01 -04:00
|
|
|
sscl::CrtCommandLineArgs::set(argc, argv, envp);
|
2026-02-22 17:46:27 -04:00
|
|
|
smo::mrntt::thread->getIoService().stop();
|
2025-07-28 07:20:44 -04:00
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
2026-02-22 17:46:27 -04:00
|
|
|
smo::mrntt::thread->thread.join();
|
2025-07-28 07:20:44 -04:00
|
|
|
std::cout << "CRT:" << __func__ << ": Mrntt exited with code '"
|
2026-02-18 01:14:26 -04:00
|
|
|
<< sscl::pptr::exitCode << "'\n";
|
|
|
|
|
return sscl::pptr::exitCode;
|
2025-01-10 17:37:49 -04:00
|
|
|
}
|