Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:ipc\mqueue.c Create Date:2022-07-28 16:50:56
Last Modify:2020-03-17 23:00:47 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Puts current task to sleep. Caller must hold queue lock. After return* lock isn't held.

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

Type:int

Parameter:

TypeParameterName
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  cycle
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;* (TASK_INTERRUPTIBLE)
651  spin_unlock( & lock)
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
656  retval = 0
657  Go to out
659  spin_lock( & lock)
661  retval = 0
662  Go to out_unlock
666  Break
668  If time == 0 Then
669  retval = -ETIMEDOUT
670  Break
673  deletes entry from list
674  out_unlock :
675  spin_unlock( & lock)
676  out :
677  Return retval
Caller
NameDescribe
do_mq_timedsend
do_mq_timedreceive