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.
This commit is contained in:
Mateusz Guzik 2021-01-06 07:11:15 +01:00
parent 71a6a0b545
commit 65f775157e

View File

@ -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)
{