Files
salmanoff/main.cpp
T

36 lines
1.1 KiB
C++
Raw Normal View History

2025-01-04 13:21:33 -04:00
#include <iostream>
#include <pthread.h>
#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
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);
pthread_setname_np(pthread_self(), "smo:CRT:main");
/* 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';
boost::asio::post(smo::mrntt::thread->getIoContext(),
[argc, argv, envp]()
{
std::cout << "Mrntt:" << __func__ << ":JOLTED: setting cmdline args"
<< '\n';
sscl::CrtCommandLineArgs::set(argc, argv, envp);
smo::mrntt::thread->getIoContext().stop();
}
);
2026-02-22 17:46:27 -04:00
smo::mrntt::thread->thread.join();
std::cout << "CRT:" << __func__ << ": Mrntt exited with code '"
2026-02-18 01:14:26 -04:00
<< sscl::pptr::exitCode << "'\n";
return sscl::pptr::exitCode;
}