Open 3D Engine AzCore API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::JobCancelGroup Class Reference

#include <JobCancelGroup.h>

Public Member Functions

 AZ_CLASS_ALLOCATOR (JobCancelGroup, ThreadPoolAllocator)
 
 JobCancelGroup ()
 
 JobCancelGroup (JobCancelGroup *parentGroup)
 
void Cancel ()
 
bool IsCancelled () const
 
void Reset ()
 

Detailed Description

Allows jobs to be cancelled. A cancelled job will not do any processing, but otherwise behaves normally, i.e. notifying dependents when it 'completes'. The JobCancelGroup a Job belongs to can be specified when the Job is created. JobCancelGroups can be arranged in a tree structure, then cancelling a parent group will also cancel all the child groups.

JobCancelGroups are not deleted by the system, the user must manage their lifetimes. They must not be deleted until their associated jobs have completed.

Note: These groups are needed because the existing dependency tree goes the wrong direction for cancellation. We need the ability to cancel an entire tree of work at once, this could be done by cancelling the 'join' job, but then the 'fork' jobs would need to check their entire dependency chain to see if they themselves should be cancelled.

Constructor & Destructor Documentation

◆ JobCancelGroup() [1/2]

AZ::JobCancelGroup::JobCancelGroup ( )
inline

Creates a group with no parent.

◆ JobCancelGroup() [2/2]

AZ::JobCancelGroup::JobCancelGroup ( JobCancelGroup parentGroup)
inline

Adds this group as a child of the specified parent group, or with no parent if parentGroup is NULL.

Member Function Documentation

◆ Cancel()

void AZ::JobCancelGroup::Cancel ( )
inline

Cancels all jobs in this group, and recursively cancels all child groups.

◆ Reset()

void AZ::JobCancelGroup::Reset ( )
inline

Resets the group to the un-cancelled state, should only really be used when the jobs are not running.


The documentation for this class was generated from the following file: