Refactor liburcu to support many flavors per compile unit
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 28 Nov 2018 17:07:09 +0000 (12:07 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 12 Dec 2018 15:18:49 +0000 (10:18 -0500)
commit4477a87021ffbfbfdb2a2084d05a084171343d36
tree91bfc81f30b301fdd6a570b8d10dc8a4640e13ec
parent5bbe95bb510534d0a5bab8d7d205b32d6e4a57b2
Refactor liburcu to support many flavors per compile unit

This refactoring keeps the prior use of liburcu "map" APIs unchanged.
However, it introduces the following new APIs:

Each urcu flavor is now available as its own header:

include/urcu/urcu-memb.h
include/urcu/urcu-mb.h
include/urcu/urcu-signal.h
include/urcu/urcu-bp.h
include/urcu/urcu-qsbr.h

The installed urcu headers that were not under the urcu/ subdirectory
are moved there:

include/urcu-call-rcu.h -> include/urcu/call-rcu.h
include/urcu-defer.h -> include/urcu/defer.h
include/urcu-flavor.h -> include/urcu/flavor.h
include/urcu-pointer.h -> include/urcu/pointer.h
include/urcu-bp.h -> include/urcu/urcu-bp.h
include/urcu.h -> include/urcu/urcu.h
include/urcu-qsbr.h -> include/urcu/urcu-qsbr.h

The liburcu "map" API is now only available for use when URCU_API_MAP is
defined before including the liburcu flavor headers.

The old headers are now placeholders defining URCU_API_MAP and including
the new headers for backward compatibility:

include/urcu-bp.h
include/urcu-call-rcu.h
include/urcu-defer.h
include/urcu-flavor.h
include/urcu-pointer.h
include/urcu-qsbr.h
include/urcu.h

The header include/urcu/urcu.h now includes the right header between the
memb, signal, or mb flavors based on the compiler defines.

The symbol names of liburcu flavors are cleaned up, favoring the
following hierarchy:

urcu_<flavor name>_...

This is an ABI-breaking change, however the previous symbols name were
kept as aliases to maintain backward compatibility. They will be removed
when the next SONAME bump occurs.

The new liburcu-memb.so shared object is introduced, properly
namespacing this flavor. It is a duplicate of the previous liburcu.so,
which is kept around for backward compatibility.

The new URCU_API_MAP macro is introduced, controlling whether the
urcu API "mapping" should stay defined after inclusion of the flavor
headers. Users wishing to use the prior urcu API should either
explicitly define URCU_API_MAP before including the urcu/urcu*.h flavor
headers, or include the flavor header files from the include toplevel
directory, which are placeholders for backward compatibility. Use of
many urcu flavors within the same _LGPL_SOURCE compile unit should not
use the "map" APIs.

Internally, the "map" header files are split into one header per
flavor. The include guards are removed, so their effect can be
applied more than once. A new include/urcu/map/clear.h header is
introduced, which undefines the mappings at the end of the flavor
header if URCU_API_MAP is not set.

The new APIs namespaced for each urcu flavor is the recommended way to
use liburcu. We can expect the prior APIs to eventually become
deprecated over time.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
48 files changed:
configure.ac
include/Makefile.am
include/urcu-bp.h [new file with mode: 0644]
include/urcu-call-rcu.h [new file with mode: 0644]
include/urcu-defer.h [new file with mode: 0644]
include/urcu-flavor.h [new file with mode: 0644]
include/urcu-pointer.h [new file with mode: 0644]
include/urcu-qsbr.h [new file with mode: 0644]
include/urcu.h [new file with mode: 0644]
include/urcu/call-rcu.h [new file with mode: 0644]
include/urcu/config.h.in
include/urcu/defer.h [new file with mode: 0644]
include/urcu/flavor.h [new file with mode: 0644]
include/urcu/map/clear.h [new file with mode: 0644]
include/urcu/map/urcu-bp.h
include/urcu/map/urcu-mb.h [new file with mode: 0644]
include/urcu/map/urcu-memb.h [new file with mode: 0644]
include/urcu/map/urcu-qsbr.h
include/urcu/map/urcu-signal.h [new file with mode: 0644]
include/urcu/map/urcu.h
include/urcu/pointer.h [new file with mode: 0644]
include/urcu/static/urcu-bp.h
include/urcu/static/urcu-common.h [new file with mode: 0644]
include/urcu/static/urcu-mb.h [new file with mode: 0644]
include/urcu/static/urcu-memb.h [new file with mode: 0644]
include/urcu/static/urcu-qsbr.h
include/urcu/static/urcu-signal.h [new file with mode: 0644]
include/urcu/static/urcu.h
include/urcu/urcu-bp.h [new file with mode: 0644]
include/urcu/urcu-mb.h [new file with mode: 0644]
include/urcu/urcu-memb.h [new file with mode: 0644]
include/urcu/urcu-qsbr.h [new file with mode: 0644]
include/urcu/urcu-signal.h [new file with mode: 0644]
include/urcu/urcu.h [new file with mode: 0644]
src/Makefile.am
src/urcu-bp.c
src/urcu-bp.h [deleted file]
src/urcu-call-rcu-impl.h
src/urcu-call-rcu.h [deleted file]
src/urcu-defer-impl.h
src/urcu-defer.h [deleted file]
src/urcu-flavor.h [deleted file]
src/urcu-pointer.h [deleted file]
src/urcu-qsbr.c
src/urcu-qsbr.h [deleted file]
src/urcu-utils.h [new file with mode: 0644]
src/urcu.c
src/urcu.h [deleted file]
This page took 0.049258 seconds and 4 git commands to generate.