Renamed counters_id to latest_counters_id to be more specific about what this variable holds

This commit is contained in:
Andrey Skobtsov 2020-05-21 23:27:33 +03:00
parent 713173a3a5
commit 5217fd7952
2 changed files with 3 additions and 3 deletions

View File

@ -169,7 +169,7 @@ const PerfEventInfo PerfEventsCounters::raw_events_info[] = {
#undef HARDWARE_EVENT #undef HARDWARE_EVENT
std::atomic<PerfEventsCounters::Id> PerfEventsCounters::counters_id = 0; std::atomic<PerfEventsCounters::Id> PerfEventsCounters::latest_counters_id = 0;
thread_local PerfDescriptorsHolder PerfEventsCounters::thread_events_descriptors_holder{}; thread_local PerfDescriptorsHolder PerfEventsCounters::thread_events_descriptors_holder{};
thread_local std::optional<PerfEventsCounters::Id> PerfEventsCounters::current_thread_counters_id = std::nullopt; thread_local std::optional<PerfEventsCounters::Id> PerfEventsCounters::current_thread_counters_id = std::nullopt;
@ -546,7 +546,7 @@ void PerfEventsCounters::closeEventDescriptors()
thread_events_descriptors_holder.releaseResources(); thread_events_descriptors_holder.releaseResources();
} }
PerfEventsCounters::PerfEventsCounters(): id(counters_id++) {} PerfEventsCounters::PerfEventsCounters(): id(latest_counters_id++) {}
PerfDescriptorsHolder::PerfDescriptorsHolder() PerfDescriptorsHolder::PerfDescriptorsHolder()
{ {

View File

@ -200,7 +200,7 @@ private:
using Id = UInt64; using Id = UInt64;
using ParsedEvents = std::pair<std::string, std::vector<size_t>>; using ParsedEvents = std::pair<std::string, std::vector<size_t>>;
static std::atomic<Id> counters_id; static std::atomic<Id> latest_counters_id;
static thread_local PerfDescriptorsHolder thread_events_descriptors_holder; static thread_local PerfDescriptorsHolder thread_events_descriptors_holder;
static thread_local std::optional<Id> current_thread_counters_id; static thread_local std::optional<Id> current_thread_counters_id;