/// RegisterStatistic - The first time a statistic is bumped, this method is /// called. void Statistic::RegisterStatistic() { // If stats are enabled, inform StatInfo that this statistic should be // printed. if (Enabled) StatInfo->addStatistic(this); // Remember we have been registered. Initialized = true; }
/// RegisterStatistic - The first time a statistic is bumped, this method is /// called. void Statistic::RegisterStatistic() { // If stats are enabled, inform StatInfo that this statistic should be // printed. sys::SmartScopedLock<true> Writer(*StatLock); if (!Initialized) { if (Enabled) StatInfo->addStatistic(this); sys::MemoryFence(); // Remember we have been registered. Initialized = true; } }
/// RegisterStatistic - The first time a statistic is bumped, this method is /// called. void Statistic::RegisterStatistic() { // If stats are enabled, inform StatInfo that this statistic should be // printed. sys::SmartScopedLock<true> Writer(*StatLock); if (!Initialized) { if (Stats || Enabled) StatInfo->addStatistic(this); TsanHappensBefore(this); sys::MemoryFence(); // Remember we have been registered. TsanIgnoreWritesBegin(); Initialized = true; TsanIgnoreWritesEnd(); } }