]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
refcount(9): Add refcount_release_if_last() and refcount_load()
authormarkj <markj@FreeBSD.org>
Wed, 4 Nov 2020 16:30:30 +0000 (16:30 +0000)
committermarkj <markj@FreeBSD.org>
Wed, 4 Nov 2020 16:30:30 +0000 (16:30 +0000)
commit9df82a28512af35925c0d5dcb0f975f086da09df
tree2c8fec667e2292faf4b516aa1b8532c1db2dde91
parent0ba928b7f4b25c7c2ef92c58c96357d70cf169e5
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