diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCoolMultChanCnv.icc b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCoolMultChanCnv.icc index 0c82990647273d036bd2c16d3b25b5f2ff73c0e4..55d928c9d0e647410e2ab8f804a3fce7c3bdb5e0 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCoolMultChanCnv.icc +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCoolMultChanCnv.icc @@ -8,7 +8,6 @@ * this case, the elements of T are written/read and their POOL * tokens are stored in CondAttrListCollection. * @author RD Schaffer <R.D.Schaffer@cern.ch> - * $Id: T_AthenaPoolCoolMultChanCnv.icc,v 1.16 2008-12-11 17:25:19 gemmeren Exp $ **/ #include "AthenaPoolCnvSvc/IAthenaPoolCnvSvc.h" @@ -142,6 +141,7 @@ T_AthenaPoolCoolMultChanCnv<COLL_T, ELEM_T, ELEM_P>::objectToAttrListColl(COLL_T typename COLL_T::iov_const_iterator itIOV = obj->iov_begin(); Token* token = 0; std::string token_str; + std::lock_guard<AthenaPoolConverter::CallMutex> lock(this->m_conv_mut); for (unsigned int chan = 0; chan < obj->size(); ++chan, ++itChan) { ELEM_T* elem = (*obj)[chan]; // Allow for T/P separation, convert to persistent object @@ -276,11 +276,13 @@ T_AthenaPoolCoolMultChanCnv<COLL_T, ELEM_T, ELEM_P>::attrListCollToObject(CondAt ATH_MSG_ERROR("PoolRef not found in attribute list"); return(StatusCode::FAILURE); } - // Allow T/P separation - set token and use createTransient - this->setToken( token ); - ELEM_T* elem = this->createTransient(); - + ELEM_T* elem {nullptr}; + { + std::lock_guard<AthenaPoolConverter::CallMutex> lock(this->m_conv_mut); + this->setToken( token ); + elem = this->createTransient(); + } // Add elem, channel number and IOV obj->push_back(elem); obj->add((*it).first); @@ -311,6 +313,7 @@ T_AthenaPoolCoolMultChanCnv<COLL_T, ELEM_T, ELEM_P>::condMultChanCollImplToObjec ELEM_T* elem = 0; // Read in the CondMultChanCollImpl + std::lock_guard<AthenaPoolConverter::CallMutex> lock(this->m_conv_mut); CondMultChanCollImpl* impl = 0; this->setToken(collImplToken); StatusCode sc = this->poolToObject(this->m_i_poolToken, impl); diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCustCnv.icc b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCustCnv.icc index 2cf16895f352ab57add9936026a26000e9b92262..c6f502e9860f8563309d3635bfaee73a8cfb2e30 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCustCnv.icc +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/T_AthenaPoolCustCnv.icc @@ -78,7 +78,6 @@ template <class TRANS, class PERS> template <class P> StatusCode T_AthenaPoolCustCnv<TRANS, PERS>::poolToObject(const Token*& token, P*& pObj) { pObj = nullptr; - const std::string className = ClassName<P>::name(); void* voidPtr = nullptr; try { this->m_athenaPoolCnvSvc->setObjPtr(voidPtr, token); @@ -91,10 +90,6 @@ StatusCode T_AthenaPoolCustCnv<TRANS, PERS>::poolToObject(const Token*& token, P return(StatusCode::FAILURE); } pObj = reinterpret_cast<P*>(voidPtr); - if (pObj == nullptr) { - ATH_MSG_ERROR("poolToObject: Failed to cast object for Token = " << (token != nullptr ? token->toString() : "")); - return(StatusCode::FAILURE); - } return(StatusCode::SUCCESS); } //__________________________________________________________________________ diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolConverter.cxx b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolConverter.cxx index 496b2eb32a5a939e33e4609e2d9c006c82eed406..2548022df67283df79336c15b4fdcd3936e560cb 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolConverter.cxx +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/src/AthenaPoolConverter.cxx @@ -13,9 +13,6 @@ #include "SGTools/DataProxy.h" #include "PersistentDataModel/Guid.h" -namespace pool { - typedef ::Guid Guid; -} #include "PersistentDataModel/Placement.h" #include "PersistentDataModel/Token.h" #include "PersistentDataModel/TokenAddress.h" @@ -53,7 +50,6 @@ long AthenaPoolConverter::repSvcType() const { } //__________________________________________________________________________ StatusCode AthenaPoolConverter::createObj(IOpaqueAddress* pAddr, DataObject*& pObj) { - std::lock_guard<CallMutex> lock(m_conv_mut); TokenAddress* tokAddr = dynamic_cast<TokenAddress*>(pAddr); bool ownTokAddr = false; if (tokAddr == nullptr || tokAddr->getToken() == nullptr) { @@ -63,6 +59,7 @@ StatusCode AthenaPoolConverter::createObj(IOpaqueAddress* pAddr, DataObject*& pO GenericAddress* genAddr = dynamic_cast<GenericAddress*>(pAddr); tokAddr = new TokenAddress(*genAddr, token); } + std::lock_guard<CallMutex> lock(m_conv_mut); m_i_poolToken = tokAddr->getToken(); try { if (!PoolToDataObject(pObj, tokAddr->getToken()).isSuccess()) { @@ -87,7 +84,6 @@ StatusCode AthenaPoolConverter::createObj(IOpaqueAddress* pAddr, DataObject*& pO } //__________________________________________________________________________ StatusCode AthenaPoolConverter::createRep(DataObject* pObj, IOpaqueAddress*& pAddr) { - std::lock_guard<CallMutex> lock(m_conv_mut); const SG::DataProxy* proxy = dynamic_cast<SG::DataProxy*>(pObj->registry()); if (proxy == nullptr) { ATH_MSG_ERROR("AthenaPoolConverter CreateRep failed to cast DataProxy, key = " @@ -95,6 +91,7 @@ StatusCode AthenaPoolConverter::createRep(DataObject* pObj, IOpaqueAddress*& pAd return(StatusCode::FAILURE); } try { + std::lock_guard<CallMutex> lock(m_conv_mut); if (!DataObjectToPers(pObj, pObj->registry()->name()).isSuccess()) { ATH_MSG_ERROR("CreateRep failed, key = " << pObj->registry()->name()); return(StatusCode::FAILURE); diff --git a/InnerDetector/InDetConditions/InDetConditionsAthenaPool/CMakeLists.txt b/InnerDetector/InDetConditions/InDetConditionsAthenaPool/CMakeLists.txt index 8500b6064c72ba49c40a126dd4459cb28499332b..a429640dec3f5eb6f4d4e773a74a45b7dcb0a5fd 100644 --- a/InnerDetector/InDetConditions/InDetConditionsAthenaPool/CMakeLists.txt +++ b/InnerDetector/InDetConditions/InDetConditionsAthenaPool/CMakeLists.txt @@ -32,7 +32,8 @@ atlas_add_poolcnv_library( InDetConditionsAthenaPoolPoolCnv src/*.cxx TRTCond::StrawDxMultChanContainer TRTCond::StrawStatusMultChanContainer TRTCond::StrawStatusContainer MULT_CHAN_TYPES TRTCond::StrawT0MultChanContainer - TRTCond::RtRelationMultChanContainer TRTCond::StrawDxMultChanContainer + TRTCond::RtRelationMultChanContainer + TRTCond::StrawDxMultChanContainer TRTCond::StrawStatusMultChanContainer LINK_LIBRARIES AthenaPoolUtilities AthenaPoolCnvSvcLib TRT_ConditionsData )