CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
edm::service::AsyncService Class Reference
Inheritance diagram for edm::service::AsyncService:
edm::Async

Public Member Functions

 AsyncService (ParameterSet const &iConfig, ActivityRegistry &iRegistry)
 
- Public Member Functions inherited from edm::Async
 Async ()=default
 
 Async (Async const &)=delete
 
 Async (Async &&)=delete
 
Asyncoperator= (Async const &)=delete
 
Asyncoperator= (Async &&)=delete
 
template<typename F , typename G >
void runAsync (WaitingTaskWithArenaHolder holder, F &&func, G &&errorContextFunc)
 
virtual ~Async () noexcept
 

Static Public Member Functions

static void fillDescriptions (ConfigurationDescriptions &descriptions)
 

Private Member Functions

void ensureAllowed () const final
 

Private Attributes

std::atomic< bool > allowed_ = true
 

Additional Inherited Members

Detailed Description

Definition at line 10 of file AsyncService.cc.

Constructor & Destructor Documentation

◆ AsyncService()

edm::service::AsyncService::AsyncService ( ParameterSet const &  iConfig,
ActivityRegistry iRegistry 
)

Definition at line 22 of file AsyncService.cc.

References allowed_, edm::ActivityRegistry::watchPostEndJob(), edm::ActivityRegistry::watchPreGlobalEarlyTermination(), edm::ActivityRegistry::watchPreSourceEarlyTermination(), and edm::ActivityRegistry::watchPreStreamEarlyTermination().

22  {
23  iRegistry.watchPreSourceEarlyTermination([this](TerminationOrigin) { allowed_ = false; });
24  iRegistry.watchPreGlobalEarlyTermination([this](GlobalContext const&, TerminationOrigin) { allowed_ = false; });
25  iRegistry.watchPreStreamEarlyTermination([this](StreamContext const&, TerminationOrigin) { allowed_ = false; });
26  iRegistry.watchPostEndJob([this]() { allowed_ = false; });
27  }
std::atomic< bool > allowed_
Definition: AsyncService.cc:19

Member Function Documentation

◆ ensureAllowed()

void edm::service::AsyncService::ensureAllowed ( ) const
finalprivatevirtual

Implements edm::Async.

Definition at line 34 of file AsyncService.cc.

References cms::Exception::addContext(), and allowed_.

34  {
35  if (not allowed_) {
36  cms::Exception ex("AsyncCallNotAllowed");
37  ex.addContext("Calling Async::run()");
38  ex << "Framework is shutting down, further run() calls are not allowed";
39  throw ex;
40  }
41  }
std::atomic< bool > allowed_
Definition: AsyncService.cc:19

◆ fillDescriptions()

void edm::service::AsyncService::fillDescriptions ( ConfigurationDescriptions descriptions)
static

Member Data Documentation

◆ allowed_

std::atomic<bool> edm::service::AsyncService::allowed_ = true
private

Definition at line 19 of file AsyncService.cc.

Referenced by AsyncService(), and ensureAllowed().