CMS 3D CMS Logo

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

#include <WaitingTask.h>

Inheritance diagram for edm::WaitingTask:
edm::EmptyWaitingTask edm::FunctorWaitingTask< F > edm::Worker::AcquireTask< T, DUMMY > edm::Worker::AcquireTask< OccurrenceTraits< EventPrincipal, BranchActionStreamBegin >, DUMMY > edm::Worker::HandleExternalWorkExceptionTask edm::Worker::RunModuleTask< T >

Public Member Functions

std::exception_ptr const * exceptionPtr () const
 Returns exception thrown by dependent task. More...
 
 WaitingTask ()
 Constructor. More...
 
 ~WaitingTask () override
 

Private Member Functions

void dependentTaskFailed (std::exception_ptr iPtr)
 Called if waited for task failed. More...
 

Private Attributes

std::atomic< std::exception_ptr * > m_ptr
 

Friends

class WaitingTaskHolder
 
class WaitingTaskList
 
class WaitingTaskWithArenaHolder
 

Detailed Description

Definition at line 36 of file WaitingTask.h.

Constructor & Destructor Documentation

◆ WaitingTask()

edm::WaitingTask::WaitingTask ( )
inline

Constructor.

Definition at line 43 of file WaitingTask.h.

43 : m_ptr{nullptr} {}

◆ ~WaitingTask()

edm::WaitingTask::~WaitingTask ( )
inlineoverride

Definition at line 44 of file WaitingTask.h.

44 { delete m_ptr.load(); };

References m_ptr.

Member Function Documentation

◆ dependentTaskFailed()

void edm::WaitingTask::dependentTaskFailed ( std::exception_ptr  iPtr)
inlineprivate

Called if waited for task failed.

Allows transfer of the exception caused by the dependent task to be moved to another thread. This method should only be called by WaitingTaskList

Definition at line 59 of file WaitingTask.h.

59  {
60  if (iPtr and not m_ptr) {
61  auto temp = std::make_unique<std::exception_ptr>(iPtr);
62  std::exception_ptr* expected = nullptr;
63  if (m_ptr.compare_exchange_strong(expected, temp.get())) {
64  temp.release();
65  }
66  }
67  }

References m_ptr, and groupFilesInBlocks::temp.

Referenced by edm::WaitingTaskList::add(), edm::WaitingTaskWithArenaHolder::doneWaiting(), edm::WaitingTaskHolder::doneWaiting(), edm::WaitingTaskHolder::presetTaskAsFailed(), and edm::WaitingTaskList::presetTaskAsFailed().

◆ exceptionPtr()

std::exception_ptr const* edm::WaitingTask::exceptionPtr ( ) const
inline

Returns exception thrown by dependent task.

If the value is non-null then the dependent task failed.

Definition at line 51 of file WaitingTask.h.

51 { return m_ptr.load(); }

References m_ptr.

Referenced by edm::FunctorWaitingTask< F >::execute(), edm::Worker::RunModuleTask< T >::execute(), edm::Worker::AcquireTask< OccurrenceTraits< EventPrincipal, BranchActionStreamBegin >, DUMMY >::execute(), and edm::WaitingTaskHolder::taskHasFailed().

Friends And Related Function Documentation

◆ WaitingTaskHolder

friend class WaitingTaskHolder
friend

Definition at line 39 of file WaitingTask.h.

◆ WaitingTaskList

friend class WaitingTaskList
friend

Definition at line 38 of file WaitingTask.h.

◆ WaitingTaskWithArenaHolder

friend class WaitingTaskWithArenaHolder
friend

Definition at line 40 of file WaitingTask.h.

Member Data Documentation

◆ m_ptr

std::atomic<std::exception_ptr*> edm::WaitingTask::m_ptr
private

Definition at line 69 of file WaitingTask.h.

Referenced by dependentTaskFailed(), exceptionPtr(), and ~WaitingTask().

edm::WaitingTask::m_ptr
std::atomic< std::exception_ptr * > m_ptr
Definition: WaitingTask.h:69
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142