Split: Expose name via CompThr's derivatives' ctors
This completes the functional work of splitting libspinscale off from SMO. Spinscale shouldn't have any real dependencies on SMO from here on out.
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
#include <stdexcept>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <pthread.h>
|
||||
#include <componentThread.h>
|
||||
|
||||
namespace sscl {
|
||||
namespace smo {
|
||||
|
||||
std::string ComponentThread::getThreadName(sscl::ThreadId id)
|
||||
std::string getThreadName(sscl::ThreadId id)
|
||||
{
|
||||
// Cast ThreadId to SmoThreadId for validation and lookup
|
||||
smo::SmoThreadId smoId = static_cast<smo::SmoThreadId>(id);
|
||||
@@ -16,7 +14,7 @@ std::string ComponentThread::getThreadName(sscl::ThreadId id)
|
||||
+ ": Invalid thread ID");
|
||||
}
|
||||
|
||||
// Use function-local static to ensure proper initialization order
|
||||
// Use function-local static to ensure proper construction order.
|
||||
static const std::string threadNames[static_cast<int>(smo::SmoThreadId::N_ITEMS)]
|
||||
= {
|
||||
"mrntt",
|
||||
@@ -30,4 +28,4 @@ std::string ComponentThread::getThreadName(sscl::ThreadId id)
|
||||
return threadNames[static_cast<int>(smoId)];
|
||||
}
|
||||
|
||||
} // namespace sscl
|
||||
} // namespace smo
|
||||
|
||||
Reference in New Issue
Block a user