发新话题
打印

【求助】do_each_task_pid 和 while_each_task_pid

【求助】do_each_task_pid 和 while_each_task_pid

do_each_task_pid () 和 while_each_task_pid () 是干吗用的?


  [CODE]if (proc->mm){
          pid_t _id = proc->pgrp;
          do_each_task_pid (_id, PIDTYPE_PGID, task);
          if (task->mm == proc->mm){
                                          result = add_task(req, task);
                  if (result){ break;}
          } while_each_task_pid (_id, PIDTYPE_PGID, task);
  }[/CODE]


do_each_task_pid(nr, type, task)
  while_each_task_pid(nr, type, task)
       Mark begin and end of a do-while loop that iterates over the per-PID list associated with
       the PID number nr of type type; in any iteration, task points to the process descriptor of
       the currently scanned element.



那在task_struct中
  遍历的是哪一个字段呢?

  PIDTYPE_PGID又是什么意思?
      

TOP

发新话题