Mind,Mrntt: Use async pattern in Mind; init threads before initializeSmo
In Mrntt, we now initialize Mind:: object threads before calling initializeSalmanoffReq(). We've also propagated the spinscale async pattern into the Mind class.
This commit is contained in:
+12
-8
@@ -20,9 +20,9 @@ public:
|
||||
Mind(void);
|
||||
~Mind(void) = default;
|
||||
|
||||
void initialize(void);
|
||||
void execute(void);
|
||||
void finalizeReq(std::function<void()> callback);
|
||||
typedef std::function<void(bool)> mindLifetimeMgmtOpCbFn;
|
||||
void initializeReq(mindLifetimeMgmtOpCbFn callback);
|
||||
void finalizeReq(mindLifetimeMgmtOpCbFn callback);
|
||||
|
||||
// ComponentThread access methods
|
||||
std::shared_ptr<ComponentThread> getComponentThread(
|
||||
@@ -33,11 +33,12 @@ public:
|
||||
std::vector<std::shared_ptr<ComponentThread>> getMindThreads() const;
|
||||
|
||||
// Thread management methods (moved from ComponentThread)
|
||||
void startAllMindThreadsReq(std::function<void()> callback = nullptr);
|
||||
void pauseAllMindThreadsReq(std::function<void()> callback = nullptr);
|
||||
void resumeAllMindThreadsReq(std::function<void()> callback = nullptr);
|
||||
void exitAllMindThreadsReq(std::function<void()> callback = nullptr);
|
||||
void joltAllMindThreadsReq(std::function<void()> callback = nullptr);
|
||||
typedef std::function<void()> mindThreadLifetimeMgmtOpCbFn;
|
||||
void joltAllMindThreadsReq(mindThreadLifetimeMgmtOpCbFn callback);
|
||||
void startAllMindThreadsReq(mindThreadLifetimeMgmtOpCbFn callback);
|
||||
void pauseAllMindThreadsReq(mindThreadLifetimeMgmtOpCbFn callback);
|
||||
void resumeAllMindThreadsReq(mindThreadLifetimeMgmtOpCbFn callback);
|
||||
void exitAllMindThreadsReq(mindThreadLifetimeMgmtOpCbFn callback);
|
||||
|
||||
// CPU distribution method
|
||||
void distributeAndPinThreadsAcrossCpus();
|
||||
@@ -73,6 +74,9 @@ private:
|
||||
bool threadsHaveBeenJolted = false;
|
||||
// Collection of ComponentThread instances (excluding marionette)
|
||||
std::vector<std::shared_ptr<ComponentThread>> componentThreads;
|
||||
|
||||
class MindLifetimeMgmtOp;
|
||||
class MindThreadLifetimeMgmtOp;
|
||||
};
|
||||
|
||||
// Global Mind instance will be defined in marionette.cpp
|
||||
|
||||
Reference in New Issue
Block a user