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

No differences found
This page took 0.025189 seconds and 4 git commands to generate.