CMS 3D CMS Logo

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

#include <WaitingTaskHolder.h>

Public Member Functions

void doneWaiting (std::exception_ptr iExcept)
 
tbb::task_group * group () const noexcept
 
bool hasTask () const noexcept
 
WaitingTaskHolderoperator= (const WaitingTaskHolder &iRHS)
 
WaitingTaskHolderoperator= (WaitingTaskHolder &&iRHS)
 
void presetTaskAsFailed (std::exception_ptr iExcept)
 
bool taskHasFailed () const noexcept
 
 WaitingTaskHolder ()
 
 WaitingTaskHolder (const WaitingTaskHolder &iHolder)
 
 WaitingTaskHolder (tbb::task_group &iGroup, edm::WaitingTask *iTask)
 
 WaitingTaskHolder (WaitingTaskHolder &&iOther)
 
 ~WaitingTaskHolder ()
 

Private Member Functions

WaitingTaskrelease_no_decrement () noexcept
 

Private Attributes

tbb::task_group * m_group
 
WaitingTaskm_task
 

Friends

class WaitingTaskList
 
class WaitingTaskWithArenaHolder
 

Detailed Description

Definition at line 32 of file WaitingTaskHolder.h.

Constructor & Destructor Documentation

◆ WaitingTaskHolder() [1/4]

edm::WaitingTaskHolder::WaitingTaskHolder ( )
inline

Definition at line 37 of file WaitingTaskHolder.h.

37 : m_task(nullptr), m_group(nullptr) {}

◆ WaitingTaskHolder() [2/4]

edm::WaitingTaskHolder::WaitingTaskHolder ( tbb::task_group &  iGroup,
edm::WaitingTask iTask 
)
inlineexplicit

Definition at line 39 of file WaitingTaskHolder.h.

39  : m_task(iTask), m_group(&iGroup) {
41  }

References edm::TaskBase::increment_ref_count(), and m_task.

◆ ~WaitingTaskHolder()

edm::WaitingTaskHolder::~WaitingTaskHolder ( )
inline

Definition at line 42 of file WaitingTaskHolder.h.

42  {
43  if (m_task) {
44  doneWaiting(std::exception_ptr{});
45  }
46  }

References doneWaiting(), and m_task.

◆ WaitingTaskHolder() [3/4]

edm::WaitingTaskHolder::WaitingTaskHolder ( const WaitingTaskHolder iHolder)
inline

Definition at line 48 of file WaitingTaskHolder.h.

48  : m_task(iHolder.m_task), m_group(iHolder.m_group) {
50  }

References edm::TaskBase::increment_ref_count(), and m_task.

◆ WaitingTaskHolder() [4/4]

edm::WaitingTaskHolder::WaitingTaskHolder ( WaitingTaskHolder &&  iOther)
inline

Definition at line 52 of file WaitingTaskHolder.h.

52  : m_task(iOther.m_task), m_group(iOther.m_group) {
53  iOther.m_task = nullptr;
54  }

Member Function Documentation

◆ doneWaiting()

void edm::WaitingTaskHolder::doneWaiting ( std::exception_ptr  iExcept)
inline

◆ group()

tbb::task_group* edm::WaitingTaskHolder::group ( ) const
inlinenoexcept

since tbb::task_group is thread safe, we can return it non-const from here since the object is not really part of the state of the holder

Definition at line 77 of file WaitingTaskHolder.h.

77 { return m_group; }

References m_group.

Referenced by edm::WaitingTaskList::add(), edm::beginGlobalTransitionAsync(), edm::EventProcessor::beginLumiAsync(), edm::beginStreamTransitionAsync(), edm::EventProcessor::continueLumiAsync(), edm::endGlobalTransitionAsync(), edm::endStreamTransitionAsync(), edm::Worker::esPrefetchAsync(), edm::EventProcessor::globalEndLumiAsync(), edm::EventProcessor::handleNextEventForStreamAsync(), edm::eventsetup::Callback< T, TReturn, TRecord, TDecorator >::prefetchAsync(), edm::DelayedReaderInputProductResolver::prefetchAsync_(), edm::PuttableProductResolver::prefetchAsync_(), edm::UnscheduledProductResolver::prefetchAsync_(), edm::SwitchProducerProductResolver::prefetchAsync_(), edm::SwitchAliasProductResolver::prefetchAsync_(), edm::NoProcessProductResolver::prefetchAsync_(), edm::eventsetup::ESSourceDataProxyBase::prefetchAsyncImpl(), edm::eventsetup::DataProxyTemplate< RecordT, DataT >::prefetchAsyncImpl(), edm::SubProcess::processAsync(), edm::EventProcessor::processEventAsync(), edm::EventProcessor::processEventAsyncImpl(), edm::StreamSchedule::processOneEventAsync(), edm::GlobalSchedule::processOneGlobalAsync(), edm::Path::processOneOccurrenceAsync(), edm::StreamSchedule::processOneStreamAsync(), edm::eventsetup::EventSetupRecordIOVQueue::startNewIOVAsync(), edm::EventProcessor::streamEndLumiAsync(), edm::OutputModuleCommunicatorT< T >::writeLumiAsync(), edm::OutputModuleCommunicatorT< T >::writeProcessBlockAsync(), and edm::OutputModuleCommunicatorT< T >::writeRunAsync().

◆ hasTask()

bool edm::WaitingTaskHolder::hasTask ( ) const
inlinenoexcept

Definition at line 73 of file WaitingTaskHolder.h.

73 { return m_task != nullptr; }

References m_task.

Referenced by edm::eventsetup::EventSetupRecordIOVQueue::endIOVAsync().

◆ operator=() [1/2]

WaitingTaskHolder& edm::WaitingTaskHolder::operator= ( const WaitingTaskHolder iRHS)
inline

Definition at line 56 of file WaitingTaskHolder.h.

56  {
57  WaitingTaskHolder tmp(iRHS);
58  std::swap(m_task, tmp.m_task);
59  std::swap(m_group, tmp.m_group);
60  return *this;
61  }

References m_group, m_task, std::swap(), and createJobs::tmp.

◆ operator=() [2/2]

WaitingTaskHolder& edm::WaitingTaskHolder::operator= ( WaitingTaskHolder &&  iRHS)
inline

Definition at line 63 of file WaitingTaskHolder.h.

63  {
65  std::swap(m_task, tmp.m_task);
66  std::swap(m_group, tmp.m_group);
67  return *this;
68  }

References m_group, m_task, eostools::move(), std::swap(), and createJobs::tmp.

◆ presetTaskAsFailed()

void edm::WaitingTaskHolder::presetTaskAsFailed ( std::exception_ptr  iExcept)
inline

Use in the case where you need to inform the parent task of a failure before some other child task which may be run later reports a different, but related failure. You must later call doneWaiting in the same thread passing the same exceptoin.

Definition at line 87 of file WaitingTaskHolder.h.

87  {
88  if (iExcept) {
89  m_task->dependentTaskFailed(iExcept);
90  }
91  }

References edm::WaitingTask::dependentTaskFailed(), and m_task.

◆ release_no_decrement()

WaitingTask* edm::WaitingTaskHolder::release_no_decrement ( )
inlineprivatenoexcept

Definition at line 112 of file WaitingTaskHolder.h.

112  {
113  auto t = m_task;
114  m_task = nullptr;
115  return t;
116  }

References m_task, and submitPVValidationJobs::t.

Referenced by edm::WaitingTaskList::add().

◆ taskHasFailed()

bool edm::WaitingTaskHolder::taskHasFailed ( ) const
inlinenoexcept

Definition at line 71 of file WaitingTaskHolder.h.

71 { return m_task->exceptionPtr() != nullptr; }

References edm::WaitingTask::exceptionPtr(), and m_task.

Referenced by edm::EventProcessor::beginLumiAsync().

Friends And Related Function Documentation

◆ WaitingTaskList

friend class WaitingTaskList
friend

Definition at line 34 of file WaitingTaskHolder.h.

◆ WaitingTaskWithArenaHolder

friend class WaitingTaskWithArenaHolder
friend

Definition at line 35 of file WaitingTaskHolder.h.

Member Data Documentation

◆ m_group

tbb::task_group* edm::WaitingTaskHolder::m_group
private

Definition at line 119 of file WaitingTaskHolder.h.

Referenced by doneWaiting(), group(), and operator=().

◆ m_task

WaitingTask* edm::WaitingTaskHolder::m_task
private
edm::WaitingTaskHolder::m_task
WaitingTask * m_task
Definition: WaitingTaskHolder.h:118
edm::WaitingTaskHolder::doneWaiting
void doneWaiting(std::exception_ptr iExcept)
Definition: WaitingTaskHolder.h:93
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
alignCSCRings.s
s
Definition: alignCSCRings.py:92
edm::WaitingTaskHolder::m_group
tbb::task_group * m_group
Definition: WaitingTaskHolder.h:119
edm::WaitingTask::exceptionPtr
std::exception_ptr const * exceptionPtr() const
Returns exception thrown by dependent task.
Definition: WaitingTask.h:51
std::swap
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
Definition: DataFrameContainer.h:209
TrackValidation_cff.task
task
Definition: TrackValidation_cff.py:252
WaitingTaskHolder
edm::WaitingTask::dependentTaskFailed
void dependentTaskFailed(std::exception_ptr iPtr)
Called if waited for task failed.
Definition: WaitingTask.h:59
edm::TaskBase::increment_ref_count
void increment_ref_count()
Definition: TaskBase.h:41
eostools.move
def move(src, dest)
Definition: eostools.py:511
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644