#include <InterchangeTaskSystem.h>
◆ FInterchangeTaskSystem()
| UE::Interchange::FInterchangeTaskSystem::FInterchangeTaskSystem |
( |
| ) |
|
The constructor should not be called directly, an ensure will be set if its the case Use the static Get function to acces the singleton.
◆ AddTask() [1/2]
Add a task without prerequisite. Return the task id. If there is an issue the returned task id will be INTERCHANGE_INVALID_TASK_ID The task will start when some thread resource will be available.
◆ AddTask() [2/2]
Add a task with some prerequisites. Return the task id. If there is an issue the returned task id will be INTERCHANGE_INVALID_TASK_ID The task will start when all prerequisites are done and some thread resource will be available.
◆ CancelTask()
| void UE::Interchange::FInterchangeTaskSystem::CancelTask |
( |
const uint64 |
TaskId, |
|
|
const bool |
bCancelPrerequisites |
|
) |
| |
Cancel a task, you can control if you cancel also the prerequisites, and subsequents. Canceling a task that is waiting will simply push it state to Done which will allow subsequent to be executed.
◆ Get()
◆ GetTaskStatus()
Return the current task status
◆ OnTaskSystemTickDelegate()
◆ WaitUntilTasksComplete()
| void UE::Interchange::FInterchangeTaskSystem::WaitUntilTasksComplete |
( |
const TArray< uint64 > & |
TasksToComplete | ) |
|
Wait can be call only on game thread. Async thread wait can create dead lock by using all the thread resources.
The caller have some restriction to follow
- This must be a safe place for any game thread task that will be executing during the wait.
- Wait should not happen from a package/asset load call stack
- Wait should not happen from a save package/asset call stack
- Wait should not happen from a garbage collect call stack
If your system need to wait and you already have some locks or you are under a unsafe place you need to redesign your system to move the wait before you get to a unsafe call stack place to wait.
The documentation for this class was generated from the following files: