函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:ipc\mqueue.c Create Date:2022-07-27 18:26:09
Last Modify:2020-03-17 23:00:47 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:Puts current task to sleep. Caller must hold queue lock. After return* lock isn't held.

函数原型:static int wq_sleep(struct mqueue_inode_info *info, int sr, ktime_t *timeout, struct ext_wait_queue *ewp)__releases(&info->lock)

返回类型:int

参数:

类型参数名称
struct mqueue_inode_info *info
intsr SEND or RECV
ktime_t *timeout
struct ext_wait_queue *ewp
646  Adds current to info->e_wait_q[sr] before element with smaller prio
648  循环
649  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;* (睡眠态)
651  自旋锁解锁
652  time等于schedule_hrtimeout_range_clock - sleep until timeout*@expires: timeout value (ktime_t)*@delta: slack in expires timeout (ktime_t)*@mode: timer mode*@clock_id: timer clock to be used
655  如果 one of STATE_* values 恒等于STATE_READY
656  retval等于0
657  转到:out
659  加自旋锁
660  如果 one of STATE_* values 恒等于STATE_READY
661  retval等于0
662  转到:out_unlock
664  如果signal_pending(当前进程)则
666  退出
668  如果time恒等于0则
669  retval等于负ETIMEDOUT
670  退出
673  删除链表项
674  out_unlock :
675  自旋锁解锁
676  out :
677  返回:retval
调用者
名称描述
do_mq_timedsend
do_mq_timedreceive