函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\sched\wait.c Create Date:2022-07-27 10:41:26
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:DEFINE_WAIT_FUNC(wait, woken_wake_func);* add_wait_queue(&wq_head, &wait);* for (;;) {* if (condition)* break;* // in wait_woken() // in woken_wake_function()* p->state = mode; wq_entry->flags |= WQ_FLAG_WOKEN;* smp_mb(); // A try_to_wake_up():* if

函数原型:long wait_woken(struct wait_queue_entry *wq_entry, unsigned mode, long timeout)

返回类型:long

参数:

类型参数名称
struct wait_queue_entry *wq_entry>flags &= ~WQ_FLAG_WOKEN; ~~~~~~~~~~~~~~~~~~
unsignedmode
longtimeout
431  set_current_state(mode)
432  如果非flags按位与WQ_FLAG_WOKEN的值且非is_kthread_should_stop()则timeout等于schedule_timeout - sleep until timeout*@timeout: timeout value in jiffies* Make the current task sleep until @timeout jiffies have* elapsed
434  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;* (就绪态)
442  smp_store_mb(flags, flags & ~WQ_FLAG_WOKEN)
444  返回:timeout
调用者
名称描述
fanotify_read
inotify_read