diff --git a/Calorimeter/CaloEvent/CaloEvent/CaloCluster.h b/Calorimeter/CaloEvent/CaloEvent/CaloCluster.h index 05979fe60345eea08b21d9f2008b8b2e1db80b60..ea622f909774ddde1d0bbca483fe033f2838d7e9 100644 --- a/Calorimeter/CaloEvent/CaloEvent/CaloCluster.h +++ b/Calorimeter/CaloEvent/CaloEvent/CaloCluster.h @@ -59,7 +59,6 @@ Update: Sep 18, 2005 P Loch #include "CaloEvent/CaloClusterBadChannelData.h" #include <vector> -#include "tbb/recursive_mutex.h" #include "GeoPrimitives/GeoPrimitives.h" diff --git a/Control/AthenaExamples/AthExHive/src/ASCIICondDbSvc.cxx b/Control/AthenaExamples/AthExHive/src/ASCIICondDbSvc.cxx index 2e762cde239e23ff19e311aa529ab8d7fdc7e7df..bf8497901a44ce1b53e6b0b822c52b716ebb4353 100644 --- a/Control/AthenaExamples/AthExHive/src/ASCIICondDbSvc.cxx +++ b/Control/AthenaExamples/AthExHive/src/ASCIICondDbSvc.cxx @@ -145,7 +145,7 @@ ASCIICondDbSvc::dump() const { void ASCIICondDbSvc::dump(std::ostringstream& ost) const { - std::lock_guard<std::recursive_mutex> lock(m_lock); + std::lock_guard<std::mutex> lock(m_lock); ost << "ASCIICondDbSvc::dump()"; @@ -226,7 +226,7 @@ StatusCode ASCIICondDbSvc::getRange(const std::string& dbKey , const EventContext& ctx, EventIDRange& rng, IASCIICondDbSvc::dbData_t& val) const { - std::lock_guard<std::recursive_mutex> lock(m_lock); + std::lock_guard<std::mutex> lock(m_lock); registry_t::const_iterator itr = m_registry.find(dbKey); diff --git a/Control/AthenaExamples/AthExHive/src/ASCIICondDbSvc.h b/Control/AthenaExamples/AthExHive/src/ASCIICondDbSvc.h index 79dbecd1f25ad335fa57466845263ebb6f6c9823..29504c326bd7a6c7a048e0b74fbb3467672acbea 100644 --- a/Control/AthenaExamples/AthExHive/src/ASCIICondDbSvc.h +++ b/Control/AthenaExamples/AthExHive/src/ASCIICondDbSvc.h @@ -48,7 +48,7 @@ private: typedef std::map<std::string, std::vector<IOVEntryT<IASCIICondDbSvc::dbData_t>>> registry_t; registry_t m_registry; - mutable std::recursive_mutex m_lock; + mutable std::mutex m_lock; }; diff --git a/Control/AthenaServices/src/LoggedMessageSvc.cxx b/Control/AthenaServices/src/LoggedMessageSvc.cxx index b57dbd89146501d0dfd81bf0d68deab03336e5a2..c06ceb01cb837decfce105978301c85d45008137 100644 --- a/Control/AthenaServices/src/LoggedMessageSvc.cxx +++ b/Control/AthenaServices/src/LoggedMessageSvc.cxx @@ -521,7 +521,7 @@ std::string LoggedMessageSvc::colTrans(std::string col, int offset) { // void LoggedMessageSvc::reportMessage( const Message& msg, int outputLevel ) { - boost::recursive_mutex::scoped_lock lock(m_reportMutex); + std::lock_guard<std::mutex> lock(m_reportMutex); int key = msg.getType(); int nmsg; @@ -659,7 +659,7 @@ void LoggedMessageSvc::reportMessage (const std::string& source, void LoggedMessageSvc::reportMessage (const StatusCode& key, const std::string& source) { - boost::recursive_mutex::scoped_lock lock(m_messageMapMutex); + std::lock_guard<std::recursive_mutex> lock(m_messageMapMutex); MessageMap::const_iterator first = m_messageMap.lower_bound( key ); if ( first != m_messageMap.end() ) { @@ -784,7 +784,7 @@ void LoggedMessageSvc::eraseStream( std::ostream* stream ) { void LoggedMessageSvc::insertMessage( const StatusCode& key, const Message& msg ) { - boost::recursive_mutex::scoped_lock lock(m_messageMapMutex); + std::lock_guard<std::recursive_mutex> lock(m_messageMapMutex); typedef MessageMap::value_type value_type; m_messageMap.insert( value_type( key, msg ) ); @@ -799,7 +799,7 @@ void LoggedMessageSvc::insertMessage( const StatusCode& key, const Message& msg void LoggedMessageSvc::eraseMessage() { - boost::recursive_mutex::scoped_lock lock(m_messageMapMutex); + std::lock_guard<std::recursive_mutex> lock(m_messageMapMutex); m_messageMap.erase( m_messageMap.begin(), m_messageMap.end() ); } @@ -813,7 +813,7 @@ void LoggedMessageSvc::eraseMessage() void LoggedMessageSvc::eraseMessage( const StatusCode& key ) { - boost::recursive_mutex::scoped_lock lock(m_messageMapMutex); + std::lock_guard<std::recursive_mutex> lock(m_messageMapMutex); m_messageMap.erase( key ); } @@ -827,7 +827,7 @@ void LoggedMessageSvc::eraseMessage( const StatusCode& key ) void LoggedMessageSvc::eraseMessage( const StatusCode& key, const Message& msg ) { - boost::recursive_mutex::scoped_lock lock(m_messageMapMutex); + std::lock_guard<std::recursive_mutex> lock(m_messageMapMutex); bool changed = true; while( changed ) { @@ -869,7 +869,7 @@ int LoggedMessageSvc::outputLevel() const { // --------------------------------------------------------------------------- int LoggedMessageSvc::outputLevel( const std::string& source ) const { // --------------------------------------------------------------------------- - boost::recursive_mutex::scoped_lock lock(m_thresholdMapMutex); + std::lock_guard<std::mutex> lock(m_thresholdMapMutex); ThresholdMap::const_iterator it; @@ -891,7 +891,7 @@ void LoggedMessageSvc::setOutputLevel(int new_level) { // --------------------------------------------------------------------------- void LoggedMessageSvc::setOutputLevel(const std::string& source, int level) { // --------------------------------------------------------------------------- - boost::recursive_mutex::scoped_lock lock(m_thresholdMapMutex); + std::lock_guard<std::mutex> lock(m_thresholdMapMutex); /* std::pair<ThresholdMap::iterator, bool> p; diff --git a/Control/AthenaServices/src/LoggedMessageSvc.h b/Control/AthenaServices/src/LoggedMessageSvc.h index a4a6ea7e663b0297545e5837a08f946fa152bba7..a36657f688a647299e644a1be15da763ea588e73 100644 --- a/Control/AthenaServices/src/LoggedMessageSvc.h +++ b/Control/AthenaServices/src/LoggedMessageSvc.h @@ -12,6 +12,7 @@ #include <map> #include <set> #include <iosfwd> +#include <mutex> #include "GaudiKernel/StatusCode.h" #include "GaudiKernel/Service.h" @@ -22,7 +23,6 @@ #include "AthenaBaseComps/AthService.h" #include "AthenaKernel/ILoggedMessageSvc.h" -#include <boost/thread/recursive_mutex.hpp> #include <boost/array.hpp> // Forward declarations @@ -105,7 +105,7 @@ public: // Implementation of IMessageSvc::setDefaultStream() virtual void setDefaultStream( std::ostream* stream ) { - boost::recursive_mutex::scoped_lock lock(m_reportMutex); + std::lock_guard<std::mutex> lock(m_reportMutex); m_defaultStream = stream; } @@ -201,14 +201,14 @@ private: const std::set<std::string>& declaredOutFileNames ); /// Mutex to synchronize multiple threads printing. - mutable boost::recursive_mutex m_reportMutex; + mutable std::mutex m_reportMutex; /// Mutex to synchronize multiple access to m_messageMap. - mutable boost::recursive_mutex m_messageMapMutex; + mutable std::recursive_mutex m_messageMapMutex; /// Mutex to synchronize multiple access to m_thresholdMap /// (@see MsgStream::doOutput). - mutable boost::recursive_mutex m_thresholdMapMutex; + mutable std::mutex m_thresholdMapMutex; std::vector< std::pair<std::string, std::string> > m_msgLog[ MSG::NUM_LEVELS ]; std::vector< LoggedMessage > m_msgKeyLog; diff --git a/Control/IOVSvc/IOVSvc/CondSvc.h b/Control/IOVSvc/IOVSvc/CondSvc.h index 22862cef6d353203d98bc31a03630b9917fc74b9..883673c4c53294488eb26ff9d6063e7040930305 100644 --- a/Control/IOVSvc/IOVSvc/CondSvc.h +++ b/Control/IOVSvc/IOVSvc/CondSvc.h @@ -77,7 +77,7 @@ private: DataObjIDColl m_condIDs; - mutable std::recursive_mutex m_lock; + mutable std::mutex m_lock; }; diff --git a/Control/IOVSvc/IOVSvc/IOVSvc.h b/Control/IOVSvc/IOVSvc/IOVSvc.h index 61383ac2e467ad171241973bc5e22c72fe1e6091..6af3d9e39ea67df64d4da136fbcd74d9fee69977 100755 --- a/Control/IOVSvc/IOVSvc/IOVSvc.h +++ b/Control/IOVSvc/IOVSvc/IOVSvc.h @@ -220,7 +220,7 @@ private: ServiceHandle<ICondSvc> p_condSvc; ServiceHandle<IProxyProviderSvc> p_pps; - mutable std::recursive_mutex m_lock; + mutable std::mutex m_lock; }; diff --git a/Control/IOVSvc/src/CondSvc.cxx b/Control/IOVSvc/src/CondSvc.cxx index d767b15ba035c08299ad832ad5cb3d62b6ef420a..4d601bdba019d6efed9b622e5b3d9ac10a0af973 100644 --- a/Control/IOVSvc/src/CondSvc.cxx +++ b/Control/IOVSvc/src/CondSvc.cxx @@ -59,7 +59,7 @@ CondSvc::dump() const { void CondSvc::dump(std::ostringstream& ost) const { - std::lock_guard<std::recursive_mutex> lock(m_lock); + std::lock_guard<std::mutex> lock(m_lock); ost << "CondSvc::dump()"; @@ -117,7 +117,7 @@ StatusCode CondSvc::regHandle(IAlgorithm* alg, const Gaudi::DataHandle& dh, const std::string& key) { - std::lock_guard<std::recursive_mutex> lock(m_lock); + std::lock_guard<std::mutex> lock(m_lock); ATH_MSG_DEBUG( "regHandle: alg: " << alg->name() << " id: " << dh.fullKey() << " dBkey: " << key ); @@ -169,7 +169,7 @@ CondSvc::regHandle(IAlgorithm* alg, const Gaudi::DataHandle& dh, bool CondSvc::getInvalidIDs(const EventContext& ctx, DataObjIDColl& invalidIDs) { - std::lock_guard<std::recursive_mutex> lock(m_lock); + std::lock_guard<std::mutex> lock(m_lock); EventIDBase now(ctx.eventID().run_number(), ctx.eventID().event_number()); @@ -206,7 +206,7 @@ CondSvc::getInvalidIDs(const EventContext& ctx, DataObjIDColl& invalidIDs) { bool CondSvc::getIDValidity(const EventContext& ctx, DataObjIDColl& validIDs, DataObjIDColl& invalidIDs) { - std::lock_guard<std::recursive_mutex> lock(m_lock); + std::lock_guard<std::mutex> lock(m_lock); EventIDBase now(ctx.eventID()); @@ -245,7 +245,7 @@ CondSvc::getIDValidity(const EventContext& ctx, DataObjIDColl& validIDs, bool CondSvc::getValidIDs(const EventContext& ctx, DataObjIDColl& validIDs) { - std::lock_guard<std::recursive_mutex> lock(m_lock); + std::lock_guard<std::mutex> lock(m_lock); EventIDBase now(ctx.eventID()); @@ -281,7 +281,7 @@ CondSvc::getValidIDs(const EventContext& ctx, DataObjIDColl& validIDs) { bool CondSvc::isValidID(const EventContext& ctx, const DataObjID& id) const { - std::lock_guard<std::recursive_mutex> lock(m_lock); + std::lock_guard<std::mutex> lock(m_lock); EventIDBase now(ctx.eventID()); diff --git a/Control/IOVSvc/src/IOVSvc.cxx b/Control/IOVSvc/src/IOVSvc.cxx index 9e3e7bfcfdcea39fe69c472c50136c84f80a0ac8..750e7d3a33ff77d51c11bcaf1ef604a8c1dd32fb 100755 --- a/Control/IOVSvc/src/IOVSvc.cxx +++ b/Control/IOVSvc/src/IOVSvc.cxx @@ -838,7 +838,7 @@ StatusCode IOVSvc::createCondObj(CondContBase* ccb, const DataObjID& id, const EventIDBase& now) { - std::lock_guard<std::recursive_mutex> lock(m_lock); + std::lock_guard<std::mutex> lock(m_lock); ATH_MSG_DEBUG("createCondObj: id: " << id << " t: " << now << " valid: " << ccb->valid(now)); diff --git a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/AthenaPoolConverter.h b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/AthenaPoolConverter.h index 7b16564fa981e465667c07a751759c0dafc4820c..7cdef6f93071121c1239c0954aa55230f1969f7c 100644 --- a/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/AthenaPoolConverter.h +++ b/Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/AthenaPoolConverter.h @@ -111,7 +111,7 @@ protected: // data const Token* m_i_poolToken; const Token* m_o_poolToken; - typedef std::recursive_mutex CallMutex; + typedef std::mutex CallMutex; mutable CallMutex m_conv_mut; }; diff --git a/Database/AthenaPOOL/EventSelectorAthenaPool/src/EventSelectorAthenaPool.cxx b/Database/AthenaPOOL/EventSelectorAthenaPool/src/EventSelectorAthenaPool.cxx index cbdd9c1fd8d544c4e022b9505ee43fe5ea880258..76a9311a75277059df43bfc0929792760f102034 100755 --- a/Database/AthenaPOOL/EventSelectorAthenaPool/src/EventSelectorAthenaPool.cxx +++ b/Database/AthenaPOOL/EventSelectorAthenaPool/src/EventSelectorAthenaPool.cxx @@ -555,7 +555,7 @@ StatusCode EventSelectorAthenaPool::createContext(IEvtSelector::Context*& ctxt) } //________________________________________________________________________________ StatusCode EventSelectorAthenaPool::next(IEvtSelector::Context& ctxt) const { - CallMutex::scoped_lock l(m_callLock); + std::lock_guard<CallMutex> lockGuard(m_callLock); if (!m_eventStreamingTool.empty() && m_eventStreamingTool->isClient()) { if (eventStore()->transientContains<AthenaAttributeList>(m_attrListKey.value())) { const DataHandle<AthenaAttributeList> oldAttrList; diff --git a/Database/AthenaPOOL/EventSelectorAthenaPool/src/EventSelectorAthenaPool.h b/Database/AthenaPOOL/EventSelectorAthenaPool/src/EventSelectorAthenaPool.h index d0a390b5beda6950bfbe6ce8f1e52b6883223ce9..01e214c385c150aa1e629cd68b6cb139e1d29e9f 100755 --- a/Database/AthenaPOOL/EventSelectorAthenaPool/src/EventSelectorAthenaPool.h +++ b/Database/AthenaPOOL/EventSelectorAthenaPool/src/EventSelectorAthenaPool.h @@ -21,7 +21,6 @@ #include "AthenaKernel/IEventShare.h" #include "AthenaKernel/ICollectionSize.h" #include "AthenaBaseComps/AthService.h" -#include "tbb/recursive_mutex.h" #include <map> @@ -227,7 +226,7 @@ private: // properties mutable int m_evtCount; // internal count of events mutable bool m_firedIncident; - typedef tbb::recursive_mutex CallMutex; + typedef std::mutex CallMutex; mutable CallMutex m_callLock; }; diff --git a/Trigger/TrigConfiguration/TrigConfHLTData/Root/HLTPrescaleSetCollection.cxx b/Trigger/TrigConfiguration/TrigConfHLTData/Root/HLTPrescaleSetCollection.cxx index 14e4090352318f042377135241fb4ab790893729..400e1f8aacf4a8e68726b425a043bcb740929740 100644 --- a/Trigger/TrigConfiguration/TrigConfHLTData/Root/HLTPrescaleSetCollection.cxx +++ b/Trigger/TrigConfiguration/TrigConfHLTData/Root/HLTPrescaleSetCollection.cxx @@ -7,6 +7,7 @@ #include <iomanip> #include <stdexcept> +#include <iostream> using namespace std; using namespace TrigConf; @@ -37,7 +38,7 @@ HLTPrescaleSetCollection::operator=(const HLTPrescaleSetCollection &) { void HLTPrescaleSetCollection::clear() { - boost::recursive_mutex::scoped_lock lock(m_prescaleSetCollection_mutex); + lock_guard<recursive_mutex> lock(m_prescaleSetCollection_mutex); for(const cont& psinfo : m_prescaleSets) delete psinfo.pss; m_prescaleSets.clear(); @@ -59,7 +60,7 @@ TrigConf::HLTPrescaleSetCollection::thePrescaleSet(unsigned int lumiblock) const return m_currentPSS; } - boost::recursive_mutex::scoped_lock lock(m_prescaleSetCollection_mutex); + lock_guard<recursive_mutex> lock(m_prescaleSetCollection_mutex); m_currentLB = lumiblock; m_currentPSS = nullptr; @@ -94,7 +95,7 @@ TrigConf::HLTPrescaleSetCollection::setPrescaleSet( HLTPrescaleSet* pss ) { * Everybody accessing m_prescaleSetCollection needs to obtain this mutex * before accessing this list. */ - boost::recursive_mutex::scoped_lock lock(m_prescaleSetCollection_mutex); + lock_guard<recursive_mutex> lock(m_prescaleSetCollection_mutex); clear(); m_prescaleSets.insert(m_prescaleSets.begin(), cont(0, pss->id(), pss)); m_currentLB = 0; @@ -120,7 +121,7 @@ TrigConf::HLTPrescaleSetCollection::addPrescaleSet( const cont& add_psinfo ) { * Everybody accessing m_prescaleSetCollection needs to obtain this mutex * before accessing this list. */ - boost::recursive_mutex::scoped_lock lock(m_prescaleSetCollection_mutex); + lock_guard<recursive_mutex> lock(m_prescaleSetCollection_mutex); if( (psinfo_it != m_prescaleSets.end()) && (psinfo_it->lb == add_psinfo.lb) ) { delete psinfo_it->pss; psinfo_it->pss = add_psinfo.pss; @@ -178,7 +179,7 @@ HLTPrescaleSetCollection::setCurrentToFirstIfUnset() { bool TrigConf::HLTPrescaleSetCollection::contains(unsigned int lumiblock, unsigned int psk) { - boost::recursive_mutex::scoped_lock lock(m_prescaleSetCollection_mutex); + lock_guard<recursive_mutex> lock(m_prescaleSetCollection_mutex); for(const cont& psinfo: m_prescaleSets) if( psinfo.lb==lumiblock && psinfo.psk==psk ) return true; return false; @@ -187,7 +188,7 @@ TrigConf::HLTPrescaleSetCollection::contains(unsigned int lumiblock, unsigned in void TrigConf::HLTPrescaleSetCollection::print(const std::string& indent, unsigned int detail) const { - boost::recursive_mutex::scoped_lock lock(m_prescaleSetCollection_mutex); + lock_guard<recursive_mutex> lock(m_prescaleSetCollection_mutex); if(detail>=1) { unsigned int count_loaded(0); for(const cont& psinfo : m_prescaleSets) @@ -198,7 +199,7 @@ TrigConf::HLTPrescaleSetCollection::print(const std::string& indent, unsigned in cout << indent << " LB PSK Loaded Name" << endl; for(const cont& psinfo : m_prescaleSets) cout << indent << setw(9) << right << psinfo.lb << setw(9) << right << psinfo.psk << " " << (psinfo.pss!=0?"yes":" no") - << " " << (psinfo.pss!=0?psinfo.pss->name():"") << endl; + << " " << (psinfo.pss!=0?psinfo.pss->name():"") << endl; } if(detail>=2) { for(const cont& psinfo : m_prescaleSets) @@ -210,7 +211,7 @@ TrigConf::HLTPrescaleSetCollection::print(const std::string& indent, unsigned in std::ostream& TrigConf::operator<<(std::ostream & o, const TrigConf::HLTPrescaleSetCollection & c) { - boost::recursive_mutex::scoped_lock lock(c.m_prescaleSetCollection_mutex); + lock_guard<recursive_mutex> lock(c.m_prescaleSetCollection_mutex); o << "HLTPrescaleSetCollection has " << c.size() << " prescale sets" << endl; if(c.size()>0) { o << " LB Prescale set key Loaded Prescale set" << endl; diff --git a/Trigger/TrigConfiguration/TrigConfHLTData/TrigConfHLTData/HLTPrescaleSetCollection.h b/Trigger/TrigConfiguration/TrigConfHLTData/TrigConfHLTData/HLTPrescaleSetCollection.h index adb1a4d95f5e213c2d8662fc9110d3c028e13a55..1f8bb431df70c616f2058460e550d1feb9eb1971 100644 --- a/Trigger/TrigConfiguration/TrigConfHLTData/TrigConfHLTData/HLTPrescaleSetCollection.h +++ b/Trigger/TrigConfiguration/TrigConfHLTData/TrigConfHLTData/HLTPrescaleSetCollection.h @@ -13,8 +13,7 @@ #include <vector> #include <utility> #include <exception> - -#include <boost/thread/recursive_mutex.hpp> +#include <mutex> namespace TrigConf { class HLTPrescaleSet; @@ -101,7 +100,7 @@ namespace TrigConf { std::list<cont> m_prescaleSets; //!< all prescale sets with start lb - mutable boost::recursive_mutex m_prescaleSetCollection_mutex; //!< Mutex for m_prescaleSetCollection + mutable std::recursive_mutex m_prescaleSetCollection_mutex; //!< Mutex for m_prescaleSetCollection friend std::ostream & operator<<(std::ostream &, const HLTPrescaleSetCollection &);