Add JobSystem.Execute utility for quick jobs running

This commit is contained in:
Wojciech Figat
2022-02-14 14:34:43 +01:00
parent 9dc49f7165
commit 7979831f5c
2 changed files with 25 additions and 1 deletions

View File

@@ -9,7 +9,14 @@
/// </summary>
API_CLASS(Static) class FLAXENGINE_API JobSystem
{
DECLARE_SCRIPTING_TYPE_MINIMAL(JobSystem);
DECLARE_SCRIPTING_TYPE_MINIMAL(JobSystem);
/// <summary>
/// Executes the job (utility to call dispatch and wait for the end).
/// </summary>
/// <param name="job">The job. Argument is an index of the job execution.</param>
/// <param name="jobCount">The job executions count.</param>
API_FUNCTION() static void Execute(const Function<void(int32)>& job, int32 jobCount = 1);
/// <summary>
/// Dispatches the job for the execution.