MINOR: ring: make the reader check the readers count before inc/dec
authorWilly Tarreau <w@1wt.eu>
Wed, 28 Feb 2024 08:03:46 +0000 (09:03 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 25 Mar 2024 17:34:19 +0000 (17:34 +0000)
commitd336d71cbb211f91e750c0fcc4dc21ed9bbf8a20
treef84f19db6f836b8e1693eede5fc796dc531c3573
parentdd8ea5d928527f262eba2004f1c9ec4779bb9e06
MINOR: ring: make the reader check the readers count before inc/dec

We'll want to reserve some special values for the readers count to
temporary lock the following message, but for this it will be mandatory
that readers check for them before incrementing/decrementing the counter.
Let'sdo that using a CAS. The readers performance is not as critical as
the writer's anyway so the slight overhead is not a problem.
src/ring.c