|
Axmol 3.0.0-89d6d9a
|
Lightweight handle returned when a job is submitted to JobSystem. More...
#include <JobSystem.h>
Public Member Functions | |
| bool | valid () const |
| Returns true if this handle refers to a submitted job. | |
| bool | isDone () const |
| Returns true once the job reaches Completed, Canceled, or Failed. | |
| bool | isRunning () const |
| Returns true while the job function is currently executing. | |
| bool | isCancelRequested () const |
| Returns true if cooperative cancellation has been requested. | |
| JobStatus | status () const |
| Returns the current job status, or JobStatus::Canceled for an invalid handle. | |
| std::exception_ptr | exception () const |
| Returns the exception captured from the job function, if status() is JobStatus::Failed. | |
| bool | requestCancel () const |
| Request cooperative cancellation. | |
| void | wait () const |
| Block until the job reaches Completed, Canceled, or Failed. | |
| bool | waitFor (std::chrono::milliseconds timeout) const |
| Block until the job reaches a terminal state or until the timeout expires. | |
Lightweight handle returned when a job is submitted to JobSystem.
JobHandle is a shared, copyable view of a job's completion state. It can be ignored for fire-and-forget work, or kept by native code that needs to wait for completion, poll status, or request cooperative cancellation.
| bool requestCancel | ( | ) | const |
Request cooperative cancellation.
If the job is still queued, it is marked Canceled and will not execute. If it is already running, the job function must observe cancellation through its own captured state or through this handle and return voluntarily.