wait_tree: Show all threads on all schedulers.

This commit is contained in:
bunnei 2018-05-05 12:08:16 -04:00
parent 9bf2a428f9
commit 5c0421ebd8

View file

@ -51,13 +51,21 @@ std::size_t WaitTreeItem::Row() const {
} }
std::vector<std::unique_ptr<WaitTreeThread>> WaitTreeItem::MakeThreadItemList() { std::vector<std::unique_ptr<WaitTreeThread>> WaitTreeItem::MakeThreadItemList() {
const auto& threads = Core::System::GetInstance().Scheduler(0)->GetThreadList();
std::vector<std::unique_ptr<WaitTreeThread>> item_list; std::vector<std::unique_ptr<WaitTreeThread>> item_list;
item_list.reserve(threads.size()); std::size_t row = 0;
auto add_threads = [&](const std::vector<Kernel::SharedPtr<Kernel::Thread>>& threads) {
for (std::size_t i = 0; i < threads.size(); ++i) { for (std::size_t i = 0; i < threads.size(); ++i) {
item_list.push_back(std::make_unique<WaitTreeThread>(*threads[i])); item_list.push_back(std::make_unique<WaitTreeThread>(*threads[i]));
item_list.back()->row = i; item_list.back()->row = row;
++row;
} }
};
add_threads(Core::System::GetInstance().Scheduler(0)->GetThreadList());
add_threads(Core::System::GetInstance().Scheduler(1)->GetThreadList());
add_threads(Core::System::GetInstance().Scheduler(2)->GetThreadList());
add_threads(Core::System::GetInstance().Scheduler(3)->GetThreadList());
return item_list; return item_list;
} }