diff --git a/Tracking/TrkAlignment/TrkAlgebraUtils/TrkAlgebraUtils/ATLAS_CHECK_THREAD_SAFETY b/Tracking/TrkAlignment/TrkAlgebraUtils/TrkAlgebraUtils/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..c78c9a6bd2891d147dacc256e90ce3cd2971fe1d --- /dev/null +++ b/Tracking/TrkAlignment/TrkAlgebraUtils/TrkAlgebraUtils/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Tracking/TrkAlignment/TrkAlgebraUtils diff --git a/Tracking/TrkAlignment/TrkAlgebraUtils/TrkAlgebraUtils/AlMat.h b/Tracking/TrkAlignment/TrkAlgebraUtils/TrkAlgebraUtils/AlMat.h index 16bfae26715733ae1410aba5ea1dd9b1c9679944..1a52f7d2808e9fbda22d233be5c9732e36e0556b 100644 --- a/Tracking/TrkAlignment/TrkAlgebraUtils/TrkAlgebraUtils/AlMat.h +++ b/Tracking/TrkAlignment/TrkAlgebraUtils/TrkAlgebraUtils/AlMat.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRKALGS_ALMAT_H @@ -95,7 +95,8 @@ class AlMat { double& elemr(long int, long int); double elemc(long int, long int) const; - inline double* ptrData() const; + inline const double* ptrData() const; + inline double* ptrData(); inline std::string pathBin() const; inline std::string pathTxt() const; @@ -162,7 +163,11 @@ inline long int AlMat::ncol() const { return m_ncol; } -inline double* AlMat::ptrData() const { +inline const double* AlMat::ptrData() const { + return m_ptr_data; +} + +inline double* AlMat::ptrData() { return m_ptr_data; } diff --git a/Tracking/TrkAlignment/TrkAlgebraUtils/TrkAlgebraUtils/AlSymMat.h b/Tracking/TrkAlignment/TrkAlgebraUtils/TrkAlgebraUtils/AlSymMat.h index 084ff29052aee13d51f77b42cf68245fc6a61990..f0a7fbb1adfff83e4e6ecf170934a8ec739b1316 100644 --- a/Tracking/TrkAlignment/TrkAlgebraUtils/TrkAlgebraUtils/AlSymMat.h +++ b/Tracking/TrkAlignment/TrkAlgebraUtils/TrkAlgebraUtils/AlSymMat.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRKALGS_ALSYMMAT_H @@ -68,7 +68,8 @@ class AlSymMat : public AlSymMatBase { virtual int diagonalize(char jobz, AlVec& w, AlMat& z) override final; virtual double determinant() override final; - inline double* ptrData() const; + inline const double* ptrData() const; + inline double* ptrData(); inline std::string pathBin() const; inline std::string pathTxt() const; @@ -107,7 +108,11 @@ inline long int AlSymMat::elem(long int i,long int j) const { }; } -inline double* AlSymMat::ptrData() const { +inline const double* AlSymMat::ptrData() const { + return m_ptr_data; +} + +inline double* AlSymMat::ptrData() { return m_ptr_data; } diff --git a/Tracking/TrkAlignment/TrkAlgebraUtils/TrkAlgebraUtils/AlVec.h b/Tracking/TrkAlignment/TrkAlgebraUtils/TrkAlgebraUtils/AlVec.h index 50182431c6fa6d946b7def73ad34f2b71bca08c4..a36eb873e3d24b70aa2ccfc6d6c38670471abbe7 100644 --- a/Tracking/TrkAlignment/TrkAlgebraUtils/TrkAlgebraUtils/AlVec.h +++ b/Tracking/TrkAlignment/TrkAlgebraUtils/TrkAlgebraUtils/AlVec.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRKALGS_ALVEC_H @@ -87,7 +87,8 @@ class AlVec { StatusCode ReadScalaPack(const std::string&); StatusCode WriteEigenvalueVec(const std::string &, bool); inline int size() const; - inline double* ptrData() const; + inline const double* ptrData() const; + inline double* ptrData(); protected: int m_size; @@ -109,7 +110,11 @@ inline int AlVec::size() const { return m_size; } -inline double* AlVec::ptrData() const { +inline const double* AlVec::ptrData() const { + return m_ptr_data; +} + +inline double* AlVec::ptrData() { return m_ptr_data; } diff --git a/Tracking/TrkAlignment/TrkAlgebraUtils/TrkAlgebraUtils/IPCMat.h b/Tracking/TrkAlignment/TrkAlgebraUtils/TrkAlgebraUtils/IPCMat.h index 0df531a9cca63bd25d9d3cc3abcb164eaf158bba..8664e9e24e0f770749a9cd94c9161057c1156f36 100644 --- a/Tracking/TrkAlignment/TrkAlgebraUtils/TrkAlgebraUtils/IPCMat.h +++ b/Tracking/TrkAlignment/TrkAlgebraUtils/TrkAlgebraUtils/IPCMat.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef TRKALGS_IPCMAT_H @@ -68,6 +68,7 @@ class IPCMat { int m_msgid; std::string m_name; MsgStream* m_log; + pid_t m_ipcmat_pid; struct MsgBuf { long mtype; diff --git a/Tracking/TrkAlignment/TrkAlgebraUtils/src/IPCMat.cxx b/Tracking/TrkAlignment/TrkAlgebraUtils/src/IPCMat.cxx index b77bb9012ea549201f759976d227e27f6fd53d0c..719c9ef9d16dccc3b54a3a4075c020e0b2d140f7 100644 --- a/Tracking/TrkAlignment/TrkAlgebraUtils/src/IPCMat.cxx +++ b/Tracking/TrkAlignment/TrkAlgebraUtils/src/IPCMat.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #include <GaudiKernel/StatusCode.h> @@ -10,8 +10,6 @@ namespace Trk { -pid_t ipcmat_pid; - /* IPCMat::IPCMat() : m_msgSvc(0), @@ -208,15 +206,15 @@ StatusCode IPCMat::init(void){ } // fork receiver - if ((ipcmat_pid = fork()) < 0) { + if ((m_ipcmat_pid = fork()) < 0) { *m_log << MSG::ERROR << "ipcmats: line: " << __LINE__ << " key: " << key << " Error number is " << errno << endmsg; return StatusCode::FAILURE; } if (m_log->level()>=MSG::INFO) - *m_log << MSG::INFO << "ipcmat_pid = " << ipcmat_pid << endmsg; + *m_log << MSG::INFO << "ipcmat_pid = " << m_ipcmat_pid << endmsg; - if (ipcmat_pid == 0) + if (m_ipcmat_pid == 0) { // ipcmatr compiled in 64 bits using same struct for message queue // as declared in IPCMat.h. Must be in PATH @@ -334,7 +332,7 @@ StatusCode IPCMat::end(){ } // let chid finish its jobs - wait4(ipcmat_pid, nullptr, 0, nullptr); + wait4(m_ipcmat_pid, nullptr, 0, nullptr); return StatusCode::SUCCESS; }