Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Trylock variant that retuns the owning task on failure.

Proto:static inline struct task_struct *__mutex_trylock_or_owner(struct mutex *lock)

Type:struct task_struct

Parameter:

TypeParameterName
struct mutex *lock
109  curr = current process
111  owner = atomic_long_read( & owner)
112  cycle
113  flags = __owner_flags(owner)
114  task = owner & ~MUTEX_FLAGS
116  If task Then
124  Else flags &= ~MUTEX_FLAG_HANDOFF
137  old = atomic_long_cmpxchg_acquire( & owner, owner, curr | flags)
138  If old == owner Then Return NULL
141  owner = old
144  Return __owner_task(owner)
Caller
NameDescribe
__mutex_trylockActual trylock that will work on any unlocked state.