From d47cdf8bee915c10ff73cc75f773e6dc15b0282f Mon Sep 17 00:00:00 2001
From: Frank Winklmeier <frank.winklmeier@cern.ch>
Date: Tue, 23 Aug 2022 17:44:14 +0200
Subject: [PATCH] xAODCoreCnv: enable thread-checker

Mark the following algorithms as not thread-safe:
- AuxStoreWrapper
- DynVarFixerAlg
- ElementLinkResetAlg
---
 Event/xAOD/xAODCoreCnv/CMakeLists.txt                     | 2 +-
 Event/xAOD/xAODCoreCnv/src/AuxStoreWrapper.h              | 8 +++-----
 Event/xAOD/xAODCoreCnv/src/DynVarFixerAlg.h               | 5 ++---
 Event/xAOD/xAODCoreCnv/src/ElementLinkResetAlg.h          | 8 +++-----
 .../xAODCoreCnv/xAODCoreCnv/ATLAS_CHECK_THREAD_SAFETY     | 1 +
 5 files changed, 10 insertions(+), 14 deletions(-)
 create mode 100644 Event/xAOD/xAODCoreCnv/xAODCoreCnv/ATLAS_CHECK_THREAD_SAFETY

diff --git a/Event/xAOD/xAODCoreCnv/CMakeLists.txt b/Event/xAOD/xAODCoreCnv/CMakeLists.txt
index f34a8164bac9..a9d553b8b084 100644
--- a/Event/xAOD/xAODCoreCnv/CMakeLists.txt
+++ b/Event/xAOD/xAODCoreCnv/CMakeLists.txt
@@ -17,7 +17,7 @@ atlas_add_component( xAODCoreCnv
    src/*.h src/*.cxx src/components/*.cxx
    INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
    LINK_LIBRARIES ${ROOT_LIBRARIES} AthContainers AthContainersInterfaces
-   AthLinks AthenaBaseComps AthenaKernel SGTools StoreGateLib xAODCore
+   AthLinks AthenaBaseComps AthenaKernel CxxUtils SGTools StoreGateLib xAODCore
    GaudiKernel xAODCoreCnvLib )
 
 # Install files from the package.
diff --git a/Event/xAOD/xAODCoreCnv/src/AuxStoreWrapper.h b/Event/xAOD/xAODCoreCnv/src/AuxStoreWrapper.h
index 1521d14c514b..75d0d35de98b 100644
--- a/Event/xAOD/xAODCoreCnv/src/AuxStoreWrapper.h
+++ b/Event/xAOD/xAODCoreCnv/src/AuxStoreWrapper.h
@@ -1,10 +1,9 @@
 // Dear emacs, this is -*- c++ -*-
 
 /*
-  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
 */
 
-// $Id: AuxStoreWrapper.h 665308 2015-05-06 14:41:26Z krasznaa $
 #ifndef XAODCORECNV_AUXSTOREWRAPPER_H
 #define XAODCORECNV_AUXSTOREWRAPPER_H
 
@@ -19,6 +18,7 @@
 #include "GaudiKernel/IClassIDSvc.h"
 #include "GaudiKernel/ServiceHandle.h"
 #include "AthenaBaseComps/AthAlgorithm.h"
+#include "CxxUtils/checker_macros.h"
 
 // Forward declaration(s):
 namespace SG {
@@ -37,10 +37,8 @@ namespace xAODMaker {
     *
     * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
     *
-    * $Revision: 665308 $
-    * $Date: 2015-05-06 16:41:26 +0200 (Wed, 06 May 2015) $
     */
-   class AuxStoreWrapper : public AthAlgorithm {
+   class ATLAS_NOT_THREAD_SAFE AuxStoreWrapper : public AthAlgorithm {
 
    public:
       /// Regular Algorithm constructor
diff --git a/Event/xAOD/xAODCoreCnv/src/DynVarFixerAlg.h b/Event/xAOD/xAODCoreCnv/src/DynVarFixerAlg.h
index 6c3f2af8a009..bd8453412afb 100644
--- a/Event/xAOD/xAODCoreCnv/src/DynVarFixerAlg.h
+++ b/Event/xAOD/xAODCoreCnv/src/DynVarFixerAlg.h
@@ -8,6 +8,7 @@
 // Gaudi/Athena include(s):
 #include "AthenaBaseComps/AthAlgorithm.h"
 #include "AthContainersInterfaces/AuxTypes.h"
+#include "CxxUtils/checker_macros.h"
 #include "StoreGate/ReadHandleKeyArray.h"
 
 // EDM include(s).
@@ -36,10 +37,8 @@ namespace xAODMaker {
    ///
    /// @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
    ///
-   /// $Revision: 803546 $
-   /// $Date: 2017-04-25 11:44:26 +0200 (Tue, 25 Apr 2017) $
    ///
-   class DynVarFixerAlg : public AthAlgorithm {
+   class ATLAS_NOT_THREAD_SAFE DynVarFixerAlg : public AthAlgorithm {
 
    public:
       /// Inherit the base class's constructor
diff --git a/Event/xAOD/xAODCoreCnv/src/ElementLinkResetAlg.h b/Event/xAOD/xAODCoreCnv/src/ElementLinkResetAlg.h
index 5faa01bc34a6..3b0dc9aa34df 100644
--- a/Event/xAOD/xAODCoreCnv/src/ElementLinkResetAlg.h
+++ b/Event/xAOD/xAODCoreCnv/src/ElementLinkResetAlg.h
@@ -1,10 +1,9 @@
 // Dear emacs, this is -*- c++ -*-
 
 /*
-  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
+  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
 */
 
-// $Id: ElementLinkResetAlg.h 788434 2016-12-07 14:46:53Z krasznaa $
 #ifndef XAODCORECNV_ELEMENTLINKRESETALG_H
 #define XAODCORECNV_ELEMENTLINKRESETALG_H
 
@@ -14,6 +13,7 @@
 
 // Gaudi/Athena include(s):
 #include "AthenaBaseComps/AthAlgorithm.h"
+#include "CxxUtils/checker_macros.h"
 
 // Forward declaration(s):
 namespace SG {
@@ -35,10 +35,8 @@ namespace xAODMaker {
     *
     * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
     *
-    * $Revision: 788434 $
-    * $Date: 2016-12-07 15:46:53 +0100 (Wed, 07 Dec 2016) $
     */
-   class ElementLinkResetAlg : public AthAlgorithm {
+   class ATLAS_NOT_THREAD_SAFE ElementLinkResetAlg : public AthAlgorithm {
 
    public:
       /// Regular Algorithm constructor
diff --git a/Event/xAOD/xAODCoreCnv/xAODCoreCnv/ATLAS_CHECK_THREAD_SAFETY b/Event/xAOD/xAODCoreCnv/xAODCoreCnv/ATLAS_CHECK_THREAD_SAFETY
new file mode 100644
index 000000000000..aa0accc41c56
--- /dev/null
+++ b/Event/xAOD/xAODCoreCnv/xAODCoreCnv/ATLAS_CHECK_THREAD_SAFETY
@@ -0,0 +1 @@
+Event/xAOD/xAODCoreCnv
-- 
GitLab