Date: Wed, 6 Jan 2021 07:36:11 GMT From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 65f775157e0d - main - seqc: add seqc_read_notmodify Message-ID: <202101060736.1067aBCF077360@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=65f775157e0d239f311e912086600f620d0c15cf commit 65f775157e0d239f311e912086600f620d0c15cf Author: Mateusz Guzik <mjg@FreeBSD.org> AuthorDate: 2021-01-06 06:11:15 +0000 Commit: Mateusz Guzik <mjg@FreeBSD.org> CommitDate: 2021-01-06 07:28:06 +0000 seqc: add seqc_read_notmodify The routine can be used when the caller does not expect to ever have to wait for anything. Checking later with seqc_consistent retains all the guarantees. --- sys/sys/seqc.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/sys/seqc.h b/sys/sys/seqc.h index a04e342ad7d3..3cfaaf3acbda 100644 --- a/sys/sys/seqc.h +++ b/sys/sys/seqc.h @@ -81,6 +81,13 @@ seqc_read_any(const seqc_t *seqcp) return (atomic_load_acq_int(__DECONST(seqc_t *, seqcp))); } +static __inline seqc_t +seqc_read_notmodify(const seqc_t *seqcp) +{ + + return (atomic_load_acq_int(__DECONST(seqc_t *, seqcp)) & ~1); +} + static __inline seqc_t seqc_read(const seqc_t *seqcp) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202101060736.1067aBCF077360>