CompThread: Rearrange global var defs

This commit is contained in:
2026-02-17 23:45:46 -04:00
parent e77ecd447d
commit a3931d7b8f

View File

@@ -14,27 +14,25 @@
namespace sscl { namespace sscl {
namespace mrntt { namespace mrntt {
// Global variable to store the marionette thread ID /* Global variable to store the marionette thread ID
// Default value is 0, but should be set by application code via setMarionetteThreadId() * Default value is 0, but should be set by application code via
* setMarionetteThreadId().
*/
ThreadId marionetteThreadId = 0; ThreadId marionetteThreadId = 0;
/* Global marionette thread instance - defined here but initialized by
* application code.
*/
std::shared_ptr<MarionetteThread> thread;
void setMarionetteThreadId(ThreadId id) void setMarionetteThreadId(ThreadId id)
{ {
marionetteThreadId = id; marionetteThreadId = id;
} }
} // namespace mrntt } // namespace mrntt
} // namespace sscl
namespace sscl {
thread_local std::shared_ptr<ComponentThread> thisComponentThread; thread_local std::shared_ptr<ComponentThread> thisComponentThread;
namespace mrntt {
// Global marionette thread instance - defined here but initialized by application
std::shared_ptr<MarionetteThread> thread;
} // namespace mrntt
// Implementation of static method // Implementation of static method
std::shared_ptr<MarionetteThread> ComponentThread::getMrntt() std::shared_ptr<MarionetteThread> ComponentThread::getMrntt()
{ {