Skip to content
Snippets Groups Projects
Commit 2e0c0bee authored by scott snyder's avatar scott snyder
Browse files

AthContainers: Missing memory fence.

We were missing a memory fence in Cache::store.
This was causing occasional threading test failures on aarch64.
parent bb8898fd
No related branches found
No related tags found
5 merge requests!69091Fix correlated smearing bug in JER in JetUncertainties in 22.0,!58791DataQualityConfigurations: Modify L1Calo config for web display,!51674Fixing hotSpotInHIST for Run3 HIST,!50012RecExConfig: Adjust log message levels from GetRunNumber and GetLBNumber,!48290AthContainers: Missing memory fence.
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
/**
* @file AthContainers/src/AuxVectorData.cxx
......@@ -515,6 +515,9 @@ void AuxVectorData::Cache::store (SG::auxid_t auxid, void* ptr)
std::fill (newcache + m_cache_len, newcache + newlen,
static_cast<void*>(0));
// The above writes must be visible before we update the cache pointers.
AthContainers_detail::fence_seq_cst();
// Store so that other threads can see it.
// The stores to m_cache must happen before the store to m_cache_len;
// we use a fence to ensure this.
......
/*
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
// $Id$
......@@ -348,8 +348,8 @@ void ThreadingTest::threadedTest()
AuxVectorData_test b;
b.setStore (&m_store);
int nthread = 10;
AthContainers_detail::thread threads[10];
constexpr int nthread = 10;
AthContainers_detail::thread threads[nthread];
m_sm.lock();
for (int i=0; i < nthread; i++)
threads[i] = AthContainers_detail::thread (testThread (*this, b, i));
......
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