38 if (!resource.second.first) {
39 resource.second.first = std::make_shared<SerialTaskQueue>();
41 ++resource.second.second;
45 ++queueAndCounter.second;
49 if (queueAndCounter.second == 1) {
51 queueAndCounter.first = std::make_shared<SerialTaskQueue>();
57 }
else if (queueAndCounter.second == 2) {
58 queueAndCounter.first = std::make_shared<SerialTaskQueue>();
63 std::pair<SharedResourcesAcquirer, std::shared_ptr<std::recursive_mutex>>
66 resourceForDelayedReader_ =
67 std::make_shared<std::recursive_mutex>();
89 std::map<std::pair<unsigned int, std::string>, std::shared_ptr<SerialTaskQueue>> sortedResources;
100 if (resource.second.second > 1) {
101 sortedResources.insert(
102 std::make_pair(std::make_pair(resource.second.second, resource.first), resource.second.first));
107 for (
auto const&
name : resourceNames) {
111 if (resource->second.second > 1) {
112 sortedResources.insert(
113 std::make_pair(std::make_pair(resource->second.second, resource->first), resource->second.first));
118 std::vector<std::shared_ptr<SerialTaskQueue>> queues;
119 queues.reserve(sortedResources.size());
120 for (
auto const& resource : sortedResources) {
121 queues.push_back(resource.second);
123 if (queues.empty()) {
126 queues.push_back(std::make_shared<SerialTaskQueue>());
edm::propagate_const< std::shared_ptr< SerialTaskQueue > > queueForDelayedReader_
SharedResourcesRegistry()
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()
std::map< std::string, std::pair< std::shared_ptr< SerialTaskQueue >, unsigned int > > resourceMap_
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()