CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
edm::WaitingThreadPool Class Reference

#include <WaitingThreadPool.h>

Public Member Functions

WaitingThreadPooloperator= (WaitingThreadPool const &)=delete
 
WaitingThreadPooloperator= (WaitingThreadPool &&)=delete
 
template<typename F , typename G >
void runAsync (WaitingTaskWithArenaHolder holder, F &&func, G &&errorContextFunc)
 
 WaitingThreadPool ()=default
 
 WaitingThreadPool (WaitingThreadPool const &)=delete
 
 WaitingThreadPool (WaitingThreadPool &&)=delete
 

Private Attributes

edm::ReusableObjectHolder< impl::WaitingThreadpool_
 

Detailed Description

Definition at line 82 of file WaitingThreadPool.h.

Constructor & Destructor Documentation

◆ WaitingThreadPool() [1/3]

edm::WaitingThreadPool::WaitingThreadPool ( )
default

◆ WaitingThreadPool() [2/3]

edm::WaitingThreadPool::WaitingThreadPool ( WaitingThreadPool const &  )
delete

◆ WaitingThreadPool() [3/3]

edm::WaitingThreadPool::WaitingThreadPool ( WaitingThreadPool &&  )
delete

Member Function Documentation

◆ operator=() [1/2]

WaitingThreadPool& edm::WaitingThreadPool::operator= ( WaitingThreadPool const &  )
delete

◆ operator=() [2/2]

WaitingThreadPool& edm::WaitingThreadPool::operator= ( WaitingThreadPool &&  )
delete

◆ runAsync()

template<typename F , typename G >
void edm::WaitingThreadPool::runAsync ( WaitingTaskWithArenaHolder  holder,
F &&  func,
G &&  errorContextFunc 
)
inline
Parameters
holderWaitingTaskWithArenaHolder object to signal the completion of 'func'
funcFunction to run in a separate thread
errorContextFuncFunction returning a string-like object that is added to the context of cms::Exception in case 'func' throws an exception

Definition at line 99 of file WaitingThreadPool.h.

References EcalMonitorTask_cff::func, and eostools::move().

Referenced by edm::Async::runAsync().

99  {
100  auto thread = pool_.makeOrGet([]() { return std::make_unique<impl::WaitingThread>(); });
101  thread->run(std::move(holder), std::forward<F>(func), std::forward<G>(errorContextFunc), std::move(thread));
102  }
edm::ReusableObjectHolder< impl::WaitingThread > pool_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ pool_

edm::ReusableObjectHolder<impl::WaitingThread> edm::WaitingThreadPool::pool_
private

Definition at line 105 of file WaitingThreadPool.h.