MCPcopy Create free account
hub / github.com/Simple-XX/SimpleKernel / GetThreadGroup

Method GetThreadGroup

src/task/task_manager.cpp:308–322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

306}
307
308auto 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
324auto TaskManager::SignalThreadGroup(Pid tgid, int signal) -> void {
325 /// @todo 实现信号机制后,向线程组中的所有线程发送信号

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected