函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Wound-Wait; wound a younger @hold_ctx if it holds the lock.* Wound the lock holder if there are waiters with older transactions than* the lock holders. Even if multiple waiters may wound the lock holder,* it's sufficient that only one does.

函数原型:static bool __ww_mutex_wound(struct mutex *lock, struct ww_acquire_ctx *ww_ctx, struct ww_acquire_ctx *hold_ctx)

返回类型:bool

参数:

类型参数名称
struct mutex *lock
struct ww_acquire_ctx *ww_ctx
struct ww_acquire_ctx *hold_ctx
393  owner等于Internal helper function; C doesn't allow us to hide it :/* DO NOT USE (outside of mutex code).
395  lockdep_assert_held( & wait_lock)
402  如果非hold_ctx则返回:false
410  如果非owner则返回:false
413  如果acquired大于0且Determine if context @a is 'after' context @b. IOW, @a is a younger* transaction than @b and depending on algorithm either needs to wait for*@b or die.
414  wounded等于1
422  如果owner不等于当前进程唤醒中断线程
425  返回:true
428  返回:false
调用者
名称描述
__ww_mutex_check_waitersWe just acquired @lock under @ww_ctx, if there are later contexts waiting* behind us on the wait-list, check if they need to die, or wound us.* See __ww_mutex_add_waiter() for the list-order construction; basically the
__ww_mutex_add_waiterAdd @waiter to the wait-list, keep the wait-list ordered by stamp, smallest* first