Fix data race
Some checks failed
weaselab/conflict-set/pipeline/head There was a failure building this commit

This commit is contained in:
2024-07-12 14:49:46 -07:00
parent 04ac41a7e7
commit f6edde0e50

View File

@@ -3060,9 +3060,18 @@ Node *firstGeqPhysical(Node *n, const std::span<const uint8_t> key) {
}
}
thread_local double accume_point_read = 0;
thread_local double accume_prefix_read = 0;
thread_local double accume_range_read = 0;
thread_local double accume_max_between = 0;
struct __attribute__((visibility("hidden"))) ConflictSet::Impl {
void check(const ReadRange *reads, Result *result, int count) {
assert(accume_point_read == 0);
assert(accume_prefix_read == 0);
assert(accume_range_read == 0);
assert(accume_max_between == 0);
for (int i = 0; i < count; ++i) {
const auto &r = reads[i];
auto begin = std::span<const uint8_t>(r.begin.p, r.begin.len);
@@ -3303,13 +3312,9 @@ struct __attribute__((visibility("hidden"))) ConflictSet::Impl {
COUNTER(node256_released_total,
"Total number of nodes of type \"Node256\" that have been released");
GAUGE(memory_bytes, "Total number of bytes in use.");
double accume_point_read = 0;
COUNTER(read_point_total, "Total number of point reads checked.");
double accume_prefix_read = 0;
COUNTER(read_prefix_total, "Total number of prefix reads checked.");
double accume_range_read = 0;
COUNTER(read_range_total, "Total number of range reads checked.");
double accume_max_between = 0;
COUNTER(read_range_node_total,
"Total number of range checks of individual nodes while "
"checking a range read.");