Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\locking\semaphore.c Create Date:2022-07-28 09:47:48
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Because this function is inlined, the 'state' parameter will be* constant, and thus optimised away by the compiler. Likewise the* 'timeout' parameter for the cases without timeouts.

Proto:static inline int __sched __down_common(struct semaphore *sem, long state, long timeout)

Type:int

Parameter:

TypeParameterName
struct semaphore *sem
longstate
longtimeout
209  list_add_tail - add a new entry*@new: new entry to be added*@head: list head to add it before* Insert a new entry before the specified head.* This is useful for implementing queues.
210  task = current process
211  up = false
213  cycle
214  If signal_pending_state(state, current process) Then Go to interrupted
216  If Value for the false possibility is greater at compile time(timeout <= 0) Then Go to timed_out
218  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;* (state)
219  raw_spin_unlock_irq( & lock)
220  timeout = schedule_timeout - sleep until timeout*@timeout: timeout value in jiffies* Make the current task sleep until @timeout jiffies have* elapsed
221  raw_spin_lock_irq( & lock)
222  If up Then Return 0
226  timed_out :
227  deletes entry from list
228  Return -ETIME
230  interrupted :
231  deletes entry from list
232  Return -EINTR
Caller
NameDescribe
__down
__down_interruptible
__down_killable
__down_timeout