@@ -8,16 +8,20 @@
|
||||
|
||||
#include "detail/render_snapshot.hpp"
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
struct snapshot {
|
||||
std::atomic<int>& live;
|
||||
std::atomic<int> &live;
|
||||
std::array<int, 64> samples{};
|
||||
explicit snapshot(std::atomic<int>& count, int value = 0) : live(count) {
|
||||
explicit snapshot(std::atomic<int> &count, int value = 0)
|
||||
: live(count) {
|
||||
++live;
|
||||
samples.fill(value);
|
||||
}
|
||||
~snapshot() { --live; }
|
||||
~snapshot() {
|
||||
--live;
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
@@ -66,7 +70,7 @@ BOOST_AUTO_TEST_CASE(sonus_snapshot_publication_overlaps_readers) {
|
||||
start.arrive_and_wait();
|
||||
for (auto index = 0; index < 20000; ++index) {
|
||||
auto guard = state.read();
|
||||
auto const* value = guard.get();
|
||||
auto const *value = guard.get();
|
||||
for (auto sample : value->samples) {
|
||||
if (sample != value->samples.front()) {
|
||||
failed.store(true);
|
||||
|
||||
Reference in New Issue
Block a user