]> git.ipfire.org Git - thirdparty/bind9.git/commit
Simple lock-free stack in <isc/stack.h>
authorTony Finch <fanf@isc.org>
Mon, 2 Jan 2023 14:49:52 +0000 (14:49 +0000)
committerTony Finch <fanf@isc.org>
Wed, 22 Feb 2023 16:13:37 +0000 (16:13 +0000)
commit36e56923ce7a5958fe5b00281ee1364afc95eb6a
treede759303efdc62e98f18150c4c75679706a590c3
parent29a7507b0417046fcd1487c8375610ed454df4b8
Simple lock-free stack in <isc/stack.h>

Add a singly-linked stack that supports lock-free prepend and drain (to
empty the list and clean up its elements).  Intended for use with QSBR
to collect objects that need safe memory reclamation, or any other user
that works with adding objects to the stack and then draining them in
one go like various work queues.

In <isc/atomic.h>, add an `atomic_ptr()` macro to make type
declarations a little less abominable, and clean up a duplicate
definition of `atomic_compare_exchange_strong_acq_rel()`
CHANGES
doc/dev/dev.md
lib/isc/Makefile.am
lib/isc/include/isc/atomic.h
lib/isc/include/isc/stack.h [new file with mode: 0644]