42 if(!resource.second.first) {
43 resource.second.first = std::make_shared<SerialTaskQueue>();
45 ++resource.second.second;
49 ++queueAndCounter.second;
53 if(queueAndCounter.second == 1) {
55 queueAndCounter.first = std::make_shared<SerialTaskQueue>();
61 }
else if(queueAndCounter.second == 2) {
62 queueAndCounter.first = std::make_shared<SerialTaskQueue>();
67 std::pair<SharedResourcesAcquirer, std::shared_ptr<std::recursive_mutex>>
70 resourceForDelayedReader_ = std::make_shared<std::recursive_mutex>();
94 std::map<std::pair<unsigned int, std::string>, std::shared_ptr<SerialTaskQueue>> sortedResources;
105 if(resource.second.second > 1) {
106 sortedResources.insert(std::make_pair(std::make_pair(resource.second.second, resource.first),resource.second.first));
111 for(
auto const&
name : resourceNames) {
115 if(resource->second.second > 1) {
116 sortedResources.insert(std::make_pair(std::make_pair(resource->second.second, resource->first),resource->second.first));
121 std::vector<std::shared_ptr<SerialTaskQueue>> queues;
122 queues.reserve(sortedResources.size());
123 for(
auto const& resource: sortedResources) {
124 queues.push_back(resource.second);
129 queues.push_back(std::make_shared<SerialTaskQueue>());
edm::propagate_const< std::shared_ptr< SerialTaskQueue > > queueForDelayedReader_
SharedResourcesRegistry()
std::map< std::string, std::pair< std::shared_ptr< SerialTaskQueue >, unsigned int > > resourceMap_
SharedResourcesAcquirer createAcquirer(std::vector< std::string > const &) const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
T & get_underlying(propagate_const< T > &)
static SharedResourcesRegistry * instance()
edm::propagate_const< std::shared_ptr< std::recursive_mutex > > resourceForDelayedReader_
void registerSharedResource(const std::string &)
A resource name must be registered before it can be used in the createAcquirer call.
static const std::string kLegacyModuleResourceName
All legacy modules share this resource.
std::pair< SharedResourcesAcquirer, std::shared_ptr< std::recursive_mutex > > createAcquirerForSourceDelayedReader()