Skip to content
Snippets Groups Projects
Commit fc3f5330 authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

LWHists: minimal thread-checker fix

Use atomic for histogram counter to avoid thread-checker warnings in
client code. In general, the `LWHists` are not thread-safe.
parent 5155203f
No related merge requests found
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
*/
......@@ -17,6 +17,8 @@
#ifndef LWHISTSTATS_H
#define LWHISTSTATS_H
#include <atomic>
class LWHistStats {
public:
static long nActiveLWHists() { return s_nActiveHists; }
......@@ -31,7 +33,7 @@ public:
private:
LWHistStats(){}
~LWHistStats(){}
static long s_nActiveHists;
static std::atomic<long> s_nActiveHists;
friend class LWHist;
};
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
*/
......@@ -15,7 +15,7 @@
#include "LWHists/LWHistStats.h"
#include "LWPools.h"
long LWHistStats::s_nActiveHists = 0;
std::atomic<long> LWHistStats::s_nActiveHists = 0;
//____________________________________________________________________
long long LWHistStats::getTotalPoolMemAllocated()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment