Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-07-16 00:28:30

0001 // -*- C++ -*-
0002 //
0003 // Package:     Framework
0004 // Class  :     SynchronousEventSetupsController
0005 //
0006 // Implementation:
0007 //     [Notes on implementation]
0008 //
0009 // Original Author:  Chris Jones, W. David Dagenhart
0010 //         Created:  Wed Jan 12 14:30:44 CST 2011
0011 //
0012 
0013 #include "FWCore/Framework/src/SynchronousEventSetupsController.h"
0014 
0015 #include "FWCore/Concurrency/interface/WaitingTaskHolder.h"
0016 #include "FWCore/Concurrency/interface/FinalWaitingTask.h"
0017 
0018 #include <algorithm>
0019 #include <iostream>
0020 #include <set>
0021 
0022 namespace edm {
0023   namespace eventsetup {
0024 
0025     SynchronousEventSetupsController::SynchronousEventSetupsController()
0026         : globalControl_(oneapi::tbb::global_control::max_allowed_parallelism, 1) {}
0027 
0028     SynchronousEventSetupsController::~SynchronousEventSetupsController() {
0029       FinalWaitingTask finalTask{taskGroup_};
0030       controller_.endIOVsAsync(edm::WaitingTaskHolder(taskGroup_, &finalTask));
0031       finalTask.waitNoThrow();
0032     }
0033 
0034     std::shared_ptr<EventSetupProvider> SynchronousEventSetupsController::makeProvider(
0035         ParameterSet& iPSet, ActivityRegistry* activityRegistry, ParameterSet const* eventSetupPset) {
0036       return controller_.makeProvider(iPSet, activityRegistry, eventSetupPset);
0037     }
0038 
0039     void SynchronousEventSetupsController::eventSetupForInstance(IOVSyncValue const& syncValue) {
0040       synchronousEventSetupForInstance(syncValue, taskGroup_, controller_);
0041     }
0042 
0043   }  // namespace eventsetup
0044 }  // namespace edm