Skip to content
Snippets Groups Projects
Unverified Commit c0949209 authored by leaves-zwx's avatar leaves-zwx Committed by GitHub
Browse files
parent 3f52f248
No related branches found
No related tags found
No related merge requests found
......@@ -128,7 +128,8 @@ void Runtime::NewAllGlobal(const Plan& plan, size_t total_piece_num, bool is_exp
Global<MemoryAllocator>::New();
Global<RegstMgr>::New(plan);
Global<ActorMsgBus>::New();
Global<ThreadMgr>::New(plan);
Global<ThreadMgr>::New();
Global<ThreadMgr>::Get()->AddPlan(plan);
Global<boxing::collective::CollectiveBoxingDeviceCtxPoller>::New();
Global<RuntimeJobDescs>::New(plan.job_confs().job_id2job_conf());
Global<summary::EventsWriter>::New();
......
......@@ -42,7 +42,7 @@ Thread* ThreadMgr::GetThrd(int64_t thrd_id) {
return iter->second.get();
}
ThreadMgr::ThreadMgr(const Plan& plan) {
void ThreadMgr::AddPlan(const Plan& plan) {
const int64_t this_rank = GlobalProcessCtx::Rank();
for (const TaskProto& task : plan.task()) {
TaskId task_id = DeserializeTaskIdFromInt64(task.task_id());
......
......@@ -29,14 +29,14 @@ class Plan;
class ThreadMgr final {
public:
OF_DISALLOW_COPY_AND_MOVE(ThreadMgr);
ThreadMgr() = delete;
ThreadMgr() = default;
~ThreadMgr();
void AddPlan(const Plan& plan);
Thread* GetThrd(int64_t thrd_id);
private:
friend class Global<ThreadMgr>;
explicit ThreadMgr(const Plan& plan);
HashMap<int64_t, std::unique_ptr<Thread>> threads_;
};
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment