Now that the one special case where multiple threads could race to
ref/unref, we can go back to using non-atomic refcnts.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21274>
static inline void
fd_ringbuffer_del(struct fd_ringbuffer *ring)
{
- if (!unref(&ring->refcnt))
+ if (--ring->refcnt > 0)
return;
ring->funcs->destroy(ring);
static inline struct fd_ringbuffer *
fd_ringbuffer_ref(struct fd_ringbuffer *ring)
{
- ref(&ring->refcnt);
+ ring->refcnt++;
return ring;
}