Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\exit.c Create Date:2022-07-28 09:03:38
Last Modify:2020-03-17 11:17:32 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:do_wait

Proto:static long do_wait(struct wait_opts *wo)

Type:long

Parameter:

TypeParameterName
struct wait_opts *wo
1424  Tracepoint for a waiting task:
1426  init_waitqueue_func_entry( & child_wait, child_wait_callback)
1427  private = current process
1428  add_wait_queue( & wait_chldexit, & child_wait)
1429  repeat :
1436  notask_error = -ECHILD
1437  If wo_type < PIDTYPE_MAX && ( Not wo_pid || Not pid_has_task(wo_pid, wo_type) ) Then Go to notask
1441  set_current_state(TASK_INTERRUPTIBLE)
1442  read_lock( & tasklist_lock)
1443  tsk = current process
1444  Do
1445  retval = Do the work of do_wait() for one thread in the group, @tsk
1446  If retval Then Go to end
1449  retval = ptrace_do_wait(wo, tsk)
1450  If retval Then Go to end
1453  If wo_flags & Don't wait on children of other threads in this group Then Break
1456  read_unlock( & tasklist_lock)
1458  notask :
1459  retval = notask_error
1460  If Not retval && Not (wo_flags & WNOHANG) Then
1462  If Not signal_pending(current process) Then
1463  schedule()
1464  Go to 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;* (Used in tsk->state: )
1469  remove_wait_queue( & wait_chldexit, & child_wait)
1470  Return retval
Caller
NameDescribe
kernel_waitid
kernel_wait4