函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\exit.c Create Date:2022-07-27 10:03:20
Last Modify:2020-03-17 11:17:32 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:do_wait

函数原型:static long do_wait(struct wait_opts *wo)

返回类型:long

参数:

类型参数名称
struct wait_opts *wo
1424  Tracepoint for a waiting task:
1426  init_waitqueue_func_entry( & child_wait, child_wait_callback)
1427  private等于当前进程
1428  add_wait_queue( & wait_chldexit, & child_wait)
1429  repeat :
1436  notask_error等于负ECHILD
1437  如果wo_type小于最大进程且非wo_pid或非pid_has_task(wo_pid, wo_type)的值则转到:notask
1441  set_current_state(睡眠态)
1442  read_lock( & tasklist_lock)
1443  tsk等于当前进程
1444  循环
1445  retval等于Do the work of do_wait() for one thread in the group, @tsk
1446  如果retval则转到:end
1449  retval等于ptrace_do_wait(wo, tsk)
1450  如果retval则转到:end
1453  如果wo_flags按位与Don't wait on children of other threads in this group 退出
1456  read_unlock( & tasklist_lock)
1458  notask :
1459  retval等于notask_error
1460  如果非retval且非wo_flags按位与WNOHANG的值则
1462  如果非signal_pending(当前进程)则
1463  schedule()
1464  转到:repeat
1467  end :
1468  set_current_state() includes a barrier so that the write of current->state* is correctly serialised wrt the caller's subsequent test of whether to* actually sleep:* for (;;) {* set_current_state(TASK_UNINTERRUPTIBLE);* if (!need_sleep)* break;* (就绪态)
1469  remove_wait_queue( & wait_chldexit, & child_wait)
1470  返回:retval
调用者
名称描述
kernel_waitid
kernel_wait4