]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
refcount(9): Add refcount_release_if_last() and refcount_load()
authorMark Johnston <markj@FreeBSD.org>
Wed, 4 Nov 2020 16:30:30 +0000 (16:30 +0000)
committerMark Johnston <markj@FreeBSD.org>
Wed, 4 Nov 2020 16:30:30 +0000 (16:30 +0000)
commite89004612a68b90e7c4667ce5e59664078424d83
tree2c8fec667e2292faf4b516aa1b8532c1db2dde91
parentd3231fbdd2e10284d62041b3704ed372efebd304
refcount(9): Add refcount_release_if_last() and refcount_load()

The former is intended for use in vmspace_exit().  The latter is to
encourage use of explicit loads rather than relying on the volatile
qualifier.  This works better with kernel sanitizers, which can
intercept atomic(9) calls, and makes tricky lockless code easier to read
by not forcing the reader to remember which variables are declared
volatile.

Reviewed by: kib, mjg, mmel
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27056
share/man/man9/refcount.9
sys/sys/refcount.h