| 306 | } |
| 307 | |
| 308 | auto TaskManager::GetThreadGroup(Pid tgid) |
| 309 | -> etl::vector<TaskControlBlock*, kernel::config::kMaxReadyTasks> { |
| 310 | etl::vector<TaskControlBlock*, kernel::config::kMaxReadyTasks> result; |
| 311 | |
| 312 | LockGuard lock_guard(task_table_lock_); |
| 313 | |
| 314 | // 遍历任务表,找到所有 tgid 匹配的线程 |
| 315 | for (auto& [pid, task] : task_table_) { |
| 316 | if (task && task->aux->tgid == tgid) { |
| 317 | result.push_back(task.get()); |
| 318 | } |
| 319 | } |
| 320 | |
| 321 | return result; |
| 322 | } |
| 323 | |
| 324 | auto TaskManager::SignalThreadGroup(Pid tgid, int signal) -> void { |
| 325 | /// @todo 实现信号机制后,向线程组中的所有线程发送信号 |
nothing calls this directly
no outgoing calls
no test coverage detected