Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:This is an implementation of the notion of "decrement a* reference count, and return locked if it decremented to zero"

Proto:int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock)

Type:int

Parameter:

TypeParameterName
atomic_t *atomic
spinlock_t *lock
24  If atomic_add_unless - add unless the number is already a given value*@v: pointer of type atomic_t*@a: the amount to add to v...*@u: ...unless v is equal to u.* Atomically adds @a to @v, if @v was not already @u.* Returns true if the addition was done. Then Return 0
28  spin_lock(lock)
29  If atomic_dec_and_test(atomic) Then Return 1
31  spin_unlock(lock)
32  Return 0