Spinscale: create new namespace sscl

This commit is contained in:
2025-12-27 16:21:22 -04:00
parent 0c4f427c0a
commit 34d76df7d9
67 changed files with 434 additions and 429 deletions
+7 -7
View File
@@ -4,20 +4,20 @@
#include <pthread.h>
#include <componentThread.h>
namespace smo {
namespace sscl {
std::string ComponentThread::getThreadName(ThreadId id)
std::string ComponentThread::getThreadName(sscl::ThreadId id)
{
// Cast ThreadId to SmoThreadId for validation and lookup
SmoThreadId smoId = static_cast<SmoThreadId>(id);
if (static_cast<int>(smoId) >= static_cast<int>(SmoThreadId::N_ITEMS))
smo::SmoThreadId smoId = static_cast<smo::SmoThreadId>(id);
if (static_cast<int>(smoId) >= static_cast<int>(smo::SmoThreadId::N_ITEMS))
{
throw std::runtime_error(std::string(__func__)
+ ": Invalid thread ID");
}
// Use function-local static to ensure proper initialization order
static const std::string threadNames[static_cast<int>(SmoThreadId::N_ITEMS)]
static const std::string threadNames[static_cast<int>(smo::SmoThreadId::N_ITEMS)]
= {
"mrntt",
"director",
@@ -30,7 +30,7 @@ std::string ComponentThread::getThreadName(ThreadId id)
return threadNames[static_cast<int>(smoId)];
}
void PuppetThread::main(PuppetThread& self)
void sscl::PuppetThread::main(sscl::PuppetThread& self)
{
std::string threadName = "smo:" + self.name;
pthread_setname_np(pthread_self(), threadName.c_str());
@@ -87,4 +87,4 @@ void PuppetThread::main(PuppetThread& self)
std::cout << self.name << ":" << __func__ << ": Exited event loop" << "\n";
}
} // namespace smo
} // namespace sscl