Spinscale: create new namespace sscl
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user