Make test utility class MemHostDataSource thread-safe
MemHostDataSource
is used in certain unit tests.
RADIUS MT unit tests required MemHostDataSource
to be thread-safe, so the TestHostCache
that derives it overrode all its methods and added a lock_guard
to each.
To avoid this boilerplate code, ideally, MemHostDataSource
should be made thread-safe itself.
This was not done at the time due to lack of time before the release.
When this is done, remember to remove the overridden methods from TestHostCache
:
premium/src/hooks/dhcp/radius/tests/access_unittests.cc
premium/src/hooks/dhcp/radius/tests/accounting_unittests.cc
@fdupont says
Note the mutex must be at most protected.
Edited by Andrei Pavel