diff --git a/Control/IOVSvc/IOVSvc/IOVSvc.h b/Control/IOVSvc/IOVSvc/IOVSvc.h index bbe15bbaf71889883a3c86a01ab524282d9b46eb..ddd4295b7386e844d6b0e5bb105adcf51929c5c1 100755 --- a/Control/IOVSvc/IOVSvc/IOVSvc.h +++ b/Control/IOVSvc/IOVSvc/IOVSvc.h @@ -210,7 +210,9 @@ private: ServiceHandle<StoreGateSvc> p_sgs, p_detStore; ServiceHandle<ICondSvc> p_condSvc; - mutable std::mutex m_lock; + // Recursive because createCondObj dereferences a DataProxy, which can + // eventually recursively call back to IOVSvc. + mutable std::recursive_mutex m_lock; }; diff --git a/Control/IOVSvc/src/IOVSvc.cxx b/Control/IOVSvc/src/IOVSvc.cxx index 08710bb5170712eed2abb8cd0a016dc146f1306e..938289b648e9cb0d581b2e52a0dccf6b6115a2c7 100755 --- a/Control/IOVSvc/src/IOVSvc.cxx +++ b/Control/IOVSvc/src/IOVSvc.cxx @@ -145,6 +145,7 @@ StatusCode IOVSvc::regProxy( const DataProxy *proxy, const std::string& key, const std::string& storeName ) { + std::lock_guard<std::recursive_mutex> lock(m_lock); IIOVSvcTool *ist = getTool( storeName ); if (ist == 0) { msg() << MSG::ERROR << "regProxy: no IOVSvcTool associated with store \"" @@ -185,6 +186,7 @@ StatusCode IOVSvc::regProxy( const CLID& clid, const std::string& key, const std::string& storeName ) { + std::lock_guard<std::recursive_mutex> lock(m_lock); IIOVSvcTool *ist = getTool( storeName ); if (ist == 0) { msg() << MSG::ERROR << "regProxy: no IOVSvcTool associated with store \"" @@ -226,6 +228,7 @@ StatusCode IOVSvc::deregProxy( const DataProxy *proxy ) { + std::lock_guard<std::recursive_mutex> lock(m_lock); IIOVSvcTool *ist = getTool( proxy ); if (ist == 0) { msg() << MSG::ERROR << "deregProxy: no IOVSvcTool found for proxy " @@ -247,6 +250,7 @@ StatusCode IOVSvc::deregProxy( const CLID& clid, const std::string& key ) { + std::lock_guard<std::recursive_mutex> lock(m_lock); IIOVSvcTool *ist = getTool( clid, key ); if (ist == 0) { msg() << MSG::ERROR << "deregProxy: no IOVSvcTool found for proxy " @@ -830,7 +834,7 @@ StatusCode IOVSvc::createCondObj(CondContBase* ccb, const DataObjID& id, const EventIDBase& now) { - std::lock_guard<std::mutex> lock(m_lock); + std::lock_guard<std::recursive_mutex> lock(m_lock); ATH_MSG_DEBUG("createCondObj: id: " << id << " t: " << now << " valid: " << ccb->valid(now));