RunTask

RunTask

#Overview

name: RunTask

This variable is created as a Console Variable (cvar).

It is referenced in 47 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of RunTask is to execute a specific task or command within the Unreal Engine’s build and installation process. It is primarily used in the BuildPatchServices module and other related systems for managing and running various tasks during the build, installation, and patching processes of Unreal Engine projects.

Key points about RunTask:

  1. Subsystems: RunTask is primarily used in the BuildPatchServices module, but it’s also referenced in other subsystems like ImageWriteQueue, DatasmithDispatcher, and InterchangeWorker.

  2. Usage: It’s typically used to initiate the execution of a specific task, often in a separate thread or as part of a task queue.

  3. Value setting: The value of RunTask is usually set when creating a task or command object. It’s often passed as a lambda function or a method pointer.

  4. Interaction: RunTask often interacts with other task management variables and methods, such as WaitForTask, CreateTask, and task queues.

  5. Special considerations:

    • Developers should ensure that tasks are properly managed and don’t cause deadlocks or race conditions.
    • Tasks should be designed to be interruptible if they’re long-running.
  6. Best practices:

    • Use RunTask for operations that may take a significant amount of time to complete.
    • Always handle task completion and errors appropriately.
    • Consider using task priorities when applicable.
    • Avoid running CPU-intensive tasks on the main thread to prevent performance issues.

In summary, RunTask is a crucial component in Unreal Engine’s task management system, particularly for build and installation processes. It allows for efficient execution of various tasks, often in a multi-threaded environment, which is essential for maintaining performance in complex build and installation scenarios.

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithCADImporter/Source/DatasmithDispatcher/Private/DatasmithCommands.cpp:15

Scope (from outer to inner):

file
namespace    DatasmithDispatcher
function     TSharedPtr<ICommand> CreateCommand

Source code excerpt:

			case ECommandId::Ping: return MakeShared<FPingCommand>();
			case ECommandId::BackPing: return MakeShared<FBackPingCommand>();
			case ECommandId::RunTask: return MakeShared<FRunTaskCommand>();
			case ECommandId::NotifyEndTask: return MakeShared<FCompletedTaskCommand>();
			case ECommandId::ImportParams: return MakeShared<FImportParametersCommand>();
			case ECommandId::Terminate: return MakeShared<FTerminateCommand>();
		}
		return nullptr;
	}

#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithCADImporter/Source/DatasmithDispatcher/Public/DatasmithCommands.h:18

Scope (from outer to inner):

file
namespace    DatasmithDispatcher

Source code excerpt:

	Ping,
	BackPing,
	RunTask,
	NotifyEndTask,
	ImportParams,
	Terminate,
	Last
};

#Loc: <Workspace>/Engine/Plugins/Enterprise/DatasmithCADImporter/Source/DatasmithDispatcher/Public/DatasmithCommands.h:84

Scope (from outer to inner):

file
namespace    DatasmithDispatcher
class        class FRunTaskCommand : public ICommand
function     virtual ECommandId GetType

Source code excerpt:

		, JobIndex(Task.Index) 
	{}
	virtual ECommandId GetType() const override { return ECommandId::RunTask; }

protected:
	virtual void SerializeImpl(FArchive&) override;

public:
	CADLibrary::FFileDescriptor JobFileDescription;

#Loc: <Workspace>/Engine/Plugins/Experimental/Mutable/Source/MutableTools/Private/MuT/CodeOptimiser.cpp:840

Scope (from outer to inner):

file
namespace    mu
function     bool ConstantGeneratorAST
lambda-function

Source code excerpt:


							// Launch constant generation on any thread
							UE::Tasks::FTask RunTask = UE::Tasks::Launch(TEXT("MutableConstantGeneration"), [TaskPtr, ImOp]()
								{
									TaskPtr->Run(ImOp);
								},
								PrepareTask,
								LowLevelTasks::ETaskPriority::BackgroundHigh);

#Loc: <Workspace>/Engine/Plugins/Experimental/Mutable/Source/MutableTools/Private/MuT/CodeOptimiser.cpp:856

Scope (from outer to inner):

file
function     bool ConstantGeneratorAST
lambda-function

Source code excerpt:

									TaskPtr->Result = nullptr;
								},
								RunTask,
								LowLevelTasks::ETaskPriority::BackgroundHigh);

							SubgraphCompletionEvent.AddPrerequisites(CompleteTask);
						}

						ConstantSubgraphs[Index].Root = nullptr;

#Loc: <Workspace>/Engine/Plugins/Interchange/Runtime/Source/Dispatcher/Private/InterchangeCommands.cpp:32

Scope (from outer to inner):

file
namespace    UE
namespace    Interchange
function     TSharedPtr<ICommand> CreateCommand

Source code excerpt:

				case ECommandId::Error: return MakeShared<FErrorCommand>();
				case ECommandId::BackPing: return MakeShared<FBackPingCommand>();
				case ECommandId::RunTask: return MakeShared<FRunTaskCommand>();
				case ECommandId::NotifyEndTask: return MakeShared<FCompletedTaskCommand>();
				case ECommandId::QueryTaskProgress: return MakeShared<FQueryTaskProgressCommand>();
				case ECommandId::CompletedQueryTaskProgress: return MakeShared<FCompletedQueryTaskProgressCommand>();
				case ECommandId::Terminate: return MakeShared<FTerminateCommand>();
			}
			return nullptr;

#Loc: <Workspace>/Engine/Plugins/Interchange/Runtime/Source/Dispatcher/Public/InterchangeCommands.h:74

Scope (from outer to inner):

file
namespace    UE
namespace    Interchange

Source code excerpt:

			Ping,
			BackPing,
			RunTask,
			NotifyEndTask,
			QueryTaskProgress,
			CompletedQueryTaskProgress,
			Terminate,
			Last
		};

#Loc: <Workspace>/Engine/Plugins/Interchange/Runtime/Source/Dispatcher/Public/InterchangeCommands.h:144

Scope (from outer to inner):

file
namespace    UE
namespace    Interchange
class        class FRunTaskCommand : public ICommand
function     virtual ECommandId GetType

Source code excerpt:

			FRunTaskCommand() = default;
			FRunTaskCommand(const FTask& Task) : JsonDescription(Task.JsonDescription), TaskIndex(Task.Index) {}
			virtual ECommandId GetType() const override { return ECommandId::RunTask; }

		protected:
			virtual void SerializeImpl(FArchive&) override;

		public:
			FString JsonDescription;

#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineRenderPasses/Private/MoviePipelineEXROutput.cpp:89

Scope (from outer to inner):

file
function     bool FEXRImageWriteTask::RunTask

Source code excerpt:

};

bool FEXRImageWriteTask::RunTask()
{
	bool bSuccess = WriteToDisk();

	if (OnCompleted)
	{
		AsyncTask(ENamedThreads::GameThread, [bSuccess, LocalOnCompleted = MoveTemp(OnCompleted)] { LocalOnCompleted(bSuccess); });

#Loc: <Workspace>/Engine/Plugins/MovieScene/MovieRenderPipeline/Source/MovieRenderPipelineRenderPasses/Public/MoviePipelineEXROutput.h:125

Scope (from outer to inner):

file
class        class FEXRImageWriteTask : public IImageWriteTaskBase

Source code excerpt:

public:

	virtual bool RunTask() override final;
	virtual void OnAbandoned() override final;

private:

	/**
	 * Run the task, attempting to write out the raw data using the currently specified parameters

#Loc: <Workspace>/Engine/Source/Developer/Windows/LiveCodingServer/Private/External/LC_LiveModule.cpp:583

Scope (from outer to inner):

file
namespace    anonymous
function     static types::vector<symbols::ObjPath> UpdateCoffCache

Source code excerpt:

					return true;
				});
				scheduler::RunTask(task);

				tasks.emplace_back(task);
			}
		}

		// wait for all tasks to end
		scheduler::RunTask(taskRoot);
		scheduler::WaitForTask(taskRoot);

		// destroy all tasks
		scheduler::DestroyTasks(tasks);
		scheduler::DestroyTask(taskRoot);

#Loc: <Workspace>/Engine/Source/Developer/Windows/LiveCodingServer/Private/External/LC_LiveModule.cpp:927

Scope (from outer to inner):

file
function     void LiveModule::Load

Source code excerpt:

		return symbols::GatherSymbols(provider);
	});
	scheduler::RunTask(taskSymbolDB);


	auto taskLibraryDB = scheduler::CreateTask(taskRoot, [diaCompilandDb]()
	{
		return symbols::GatherLibraries(diaCompilandDb);
	});
	scheduler::RunTask(taskLibraryDB);


	auto taskContributionDB = scheduler::CreateTask(taskRoot, [this]()
	{
		symbols::Provider* localProvider = symbols::OpenEXE(m_moduleName.c_str(), symbols::OpenOptions::NONE);
		symbols::DiaCompilandDB* localDiaCompilandDb = symbols::GatherDiaCompilands(localProvider);

#Loc: <Workspace>/Engine/Source/Developer/Windows/LiveCodingServer/Private/External/LC_LiveModule.cpp:949

Scope (from outer to inner):

file
function     void LiveModule::Load

Source code excerpt:

		return db;
	});
	scheduler::RunTask(taskContributionDB);


	auto taskCompilandDB = scheduler::CreateTask(taskRoot, [this]()
	{
		symbols::Provider* localProvider = symbols::OpenEXE(m_moduleName.c_str(), symbols::OpenOptions::NONE);
		symbols::DiaCompilandDB* localDiaCompilandDb = symbols::GatherDiaCompilands(localProvider);

#Loc: <Workspace>/Engine/Source/Developer/Windows/LiveCodingServer/Private/External/LC_LiveModule.cpp:1002

Scope (from outer to inner):

file
function     void LiveModule::Load

Source code excerpt:

		return db;
	});
	scheduler::RunTask(taskCompilandDB);


	auto taskThunkDB = scheduler::CreateTask(taskRoot, [linkerSymbol]()
	{
		return symbols::GatherThunks(linkerSymbol);
	});
	scheduler::RunTask(taskThunkDB);


	auto taskImageSectionDB = scheduler::CreateTask(taskRoot, [linkerSymbol]()
	{
		return symbols::GatherImageSections(linkerSymbol);
	});
	scheduler::RunTask(taskImageSectionDB);


	auto taskLinkerDB = scheduler::CreateTask(taskRoot, [linkerSymbol]()
	{
		return symbols::GatherLinker(linkerSymbol);
	});
	scheduler::RunTask(taskLinkerDB);


	// ensure asynchronous operations have finished
	scheduler::RunTask(taskRoot);
	scheduler::WaitForTask(taskRoot);

	m_symbolDB = taskSymbolDB->GetResult();
	m_contributionDB = taskContributionDB->GetResult();
	m_compilandDB = taskCompilandDB->GetResult();
	m_libraryDB = taskLibraryDB->GetResult();

#Loc: <Workspace>/Engine/Source/Developer/Windows/LiveCodingServer/Private/External/LC_LiveModule.cpp:1181

Scope (from outer to inner):

file
function     void LiveModule::Load

Source code excerpt:

				return GatherResult { database, objPath };
			});
			scheduler::RunTask(task);

			gatherTasks.emplace_back(task);
		}

		// wait for all tasks to end
		scheduler::RunTask(gatherTaskRoot);
		scheduler::WaitForTask(gatherTaskRoot);

		// store the databases into the cache
		{
			const size_t count = gatherTasks.size();
			for (size_t i = 0u; i < count; ++i)

#Loc: <Workspace>/Engine/Source/Developer/Windows/LiveCodingServer/Private/External/LC_LiveModule.cpp:1596

Scope (from outer to inner):

file
function     LiveModule::ErrorType::Enum LiveModule::Update

Source code excerpt:

							return GatherResult { fileIndex, database };
						});
						scheduler::RunTask(task);

						gatherTasks.emplace_back(task);
					}
				}

				++fileIndex;

#Loc: <Workspace>/Engine/Source/Developer/Windows/LiveCodingServer/Private/External/LC_LiveModule.cpp:1607

Scope (from outer to inner):

file
function     LiveModule::ErrorType::Enum LiveModule::Update

Source code excerpt:


		// wait for all tasks to end
		scheduler::RunTask(taskRoot);
		scheduler::WaitForTask(taskRoot);

		// store the databases into the cache
		{
			const size_t count = gatherTasks.size();
			for (size_t i=0u; i < count; ++i)

#Loc: <Workspace>/Engine/Source/Developer/Windows/LiveCodingServer/Private/External/LC_LiveModule.cpp:1689

Scope (from outer to inner):

file
function     LiveModule::ErrorType::Enum LiveModule::Update

Source code excerpt:

						return LocalCompileResult{ i, compileScope.ReadSeconds(), result };
					});
					scheduler::RunTask(task);

					availableModifiedFiles[i].compiledOnce = true;
					compileTasks.emplace_back(task);
				}
			}

			// wait for all tasks to end
			scheduler::RunTask(taskRoot);
			scheduler::WaitForTask(taskRoot);

			// if any of the PCHs failed to compile, we need to bail out and cannot compile other files
			const size_t taskCount = compileTasks.size();
			for (size_t i = 0u; i < taskCount; ++i)
			{

#Loc: <Workspace>/Engine/Source/Developer/Windows/LiveCodingServer/Private/External/LC_LiveModule.cpp:1770

Scope (from outer to inner):

file
function     LiveModule::ErrorType::Enum LiveModule::Update

Source code excerpt:

						return LocalCompileResult{ i, compileScope.ReadSeconds(), result };
					});
					scheduler::RunTask(task);

					availableModifiedFiles[i].compiledOnce = true;
					compileTasks.emplace_back(task);
				}
			}

			// wait for all tasks to end
			scheduler::RunTask(taskRoot);
			scheduler::WaitForTask(taskRoot);

			// bail out if any of the files failed to compile
			const size_t taskCount = compileTasks.size();
			for (size_t i = 0u; i < taskCount; ++i)
			{

#Loc: <Workspace>/Engine/Source/Developer/Windows/LiveCodingServer/Private/External/LC_LiveModule.cpp:1889

Scope (from outer to inner):

file
function     LiveModule::ErrorType::Enum LiveModule::Update

Source code excerpt:

						return LocalCompileResult{ fileIndex, compileScope.ReadSeconds(), result };
					});
					scheduler::RunTask(task);

					compileTasks.emplace_back(task);
				}
				else
				{
					// the corresponding PDB file is being written to by several compilands, serialize access using the /FS option

#Loc: <Workspace>/Engine/Source/Developer/Windows/LiveCodingServer/Private/External/LC_LiveModule.cpp:1909

Scope (from outer to inner):

file
function     LiveModule::ErrorType::Enum LiveModule::Update

Source code excerpt:

							return LocalCompileResult{ fileIndex, compileScope.ReadSeconds(), result };
						});
						scheduler::RunTask(task);

						compileTasks.emplace_back(task);
					}
				}
			}

			// wait for all tasks to end
			scheduler::RunTask(taskRoot);
			scheduler::WaitForTask(taskRoot);

			// bail out if any of the files failed to compile
			const size_t taskCount = compileTasks.size();
			for (size_t i = 0u; i < taskCount; ++i)
			{

#Loc: <Workspace>/Engine/Source/Developer/Windows/LiveCodingServer/Private/External/LC_LiveModule.cpp:2233

Scope (from outer to inner):

file
function     LiveModule::ErrorType::Enum LiveModule::Update

Source code excerpt:

							return true;
						});
						scheduler::RunTask(task);

						tasks.emplace_back(task);
					}
				}

				// wait for all tasks to end
				scheduler::RunTask(taskRoot);
				scheduler::WaitForTask(taskRoot);

				// destroy tasks
				scheduler::DestroyTasks(tasks);
				scheduler::DestroyTask(taskRoot);
			}

#Loc: <Workspace>/Engine/Source/Developer/Windows/LiveCodingServer/Private/External/LC_LiveModule.cpp:3427

Scope (from outer to inner):

file
function     LiveModule::ErrorType::Enum LiveModule::Update

Source code excerpt:

		return symbols::GatherSymbols(patchSymbolProvider);
	});
	scheduler::RunTask(taskPatch_symbolDB);


	auto taskPatch_contributionDB = scheduler::CreateTask(taskRootPatchLoading, [exePath]()
	{
		symbols::Provider* localProvider = symbols::OpenEXE(exePath.c_str(), symbols::OpenOptions::NONE);
		symbols::DiaCompilandDB* localDiaCompilandDb = symbols::GatherDiaCompilands(localProvider);

#Loc: <Workspace>/Engine/Source/Developer/Windows/LiveCodingServer/Private/External/LC_LiveModule.cpp:3442

Scope (from outer to inner):

file
function     LiveModule::ErrorType::Enum LiveModule::Update

Source code excerpt:

		return db;
	});
	scheduler::RunTask(taskPatch_contributionDB);


	// note that we only gather symbols from .obj contained in the new patch executable.
	// therefore we need to extract its compiland database as well, and cannot use the one from
	// the original executable.
	auto taskPatch_compilandDB = scheduler::CreateTask(taskRootPatchLoading, [this, exePath]()

#Loc: <Workspace>/Engine/Source/Developer/Windows/LiveCodingServer/Private/External/LC_LiveModule.cpp:3480

Scope (from outer to inner):

file
function     LiveModule::ErrorType::Enum LiveModule::Update

Source code excerpt:

		return db;
	});
	scheduler::RunTask(taskPatch_compilandDB);


	auto taskPatch_thunkDB = scheduler::CreateTask(taskRootPatchLoading, [patch_linkerSymbol]()
	{
		return symbols::GatherThunks(patch_linkerSymbol);
	});
	scheduler::RunTask(taskPatch_thunkDB);


	auto taskPatch_imageSectionDB = scheduler::CreateTask(taskRootPatchLoading, [patch_linkerSymbol]()
	{
		return symbols::GatherImageSections(patch_linkerSymbol);
	});
	scheduler::RunTask(taskPatch_imageSectionDB);


	// ensure asynchronous operations have finished
	scheduler::RunTask(taskRootPatchLoading);
	scheduler::WaitForTask(taskRootPatchLoading);

	// fetch results
	symbols::SymbolDB* patch_symbolDB = taskPatch_symbolDB->GetResult();
	symbols::ContributionDB* patch_contributionDB = taskPatch_contributionDB->GetResult();
	symbols::CompilandDB* patch_compilandDB = taskPatch_compilandDB->GetResult();

#Loc: <Workspace>/Engine/Source/Developer/Windows/LiveCodingServer/Private/External/LC_Scheduler.cpp:137

Scope (from outer to inner):

file
function     void scheduler::RunTask

Source code excerpt:



void scheduler::RunTask(TaskBase* task)
{
	g_taskQueue->PushTask(task);
}


void scheduler::WaitForTask(TaskBase* task)

#Loc: <Workspace>/Engine/Source/Developer/Windows/LiveCodingServer/Private/External/LC_Scheduler.h:47

Scope (from outer to inner):

file
namespace    scheduler

Source code excerpt:



	void RunTask(TaskBase* task);

	void WaitForTask(TaskBase* task);
}

#Loc: <Workspace>/Engine/Source/Developer/Windows/LiveCodingServer/Private/External/LC_ServerCommandThread.cpp:393

Scope (from outer to inner):

file
function     scheduler::Task<LiveModule*>* ServerCommandThread::LoadModule

Source code excerpt:

	});

	scheduler::RunTask(task);

	return task;
}


bool ServerCommandThread::UnloadModule(Process::Id processId, const wchar_t* givenModulePath)

#Loc: <Workspace>/Engine/Source/Developer/Windows/LiveCodingServer/Private/External/LC_ServerCommandThread.cpp:564

Scope (from outer to inner):

file
function     void ServerCommandThread::PrewarmCompilerEnvironmentCache

Source code excerpt:

			return true;
		});
		scheduler::RunTask(task);

		tasks.emplace_back(task);
	}

	// wait for all tasks to end
	scheduler::RunTask(taskRoot);
	scheduler::WaitForTask(taskRoot);

	// destroy all tasks
	scheduler::DestroyTasks(tasks);
	scheduler::DestroyTask(taskRoot);

#Loc: <Workspace>/Engine/Source/Developer/Windows/LiveCodingServer/Private/External/LC_ServerCommandThread.cpp:2040

Scope (from outer to inner):

file
function     bool ServerCommandThread::actions::EnableModules::Execute

Source code excerpt:


	// wait for all tasks to finish
	scheduler::RunTask(rootTask);
	scheduler::WaitForTask(rootTask);

	const size_t loadModuleTaskCount = loadModuleTasks.size();
	commandThread->m_liveModules.reserve(loadModuleTaskCount);

	size_t loadedTranslationUnits = 0u;

#Loc: <Workspace>/Engine/Source/Developer/Windows/LiveCodingServer/Private/External/LC_ServerCommandThread.cpp:2199

Scope (from outer to inner):

file
function     bool ServerCommandThread::actions::EnableModulesEx::Execute

Source code excerpt:


	// wait for all tasks to finish
	scheduler::RunTask(rootTask);
	scheduler::WaitForTask(rootTask);

	const size_t loadModuleTaskCount = loadModuleTasks.size();
	commandThread->m_liveModules.reserve(loadModuleTaskCount);

	size_t loadedTranslationUnits = 0u;

#Loc: <Workspace>/Engine/Source/Editor/Blutility/Private/EditorUtilitySubsystem.cpp:57

Scope (from outer to inner):

file
function     void UEditorUtilitySubsystem::Initialize

Source code excerpt:

{
	RunTaskCommandObject = IConsoleManager::Get().RegisterConsoleCommand(
		TEXT("RunTask"),
		TEXT(""),
		FConsoleCommandWithWorldArgsAndOutputDeviceDelegate::CreateUObject(this, &UEditorUtilitySubsystem::RunTaskCommand),
		ECVF_Default
	);

	CancelAllTasksCommandObject = IConsoleManager::Get().RegisterConsoleCommand(
		TEXT("CancelAllTasks"),
		TEXT(""),
		FConsoleCommandWithWorldArgsAndOutputDeviceDelegate::CreateUObject(this, &UEditorUtilitySubsystem::CancelAllTasksCommand),
		ECVF_Default
	);

#Loc: <Workspace>/Engine/Source/Programs/Enterprise/Datasmith/DatasmithCADWorker/Private/DatasmithCADWorkerImpl.cpp:62

Scope (from outer to inner):

file
function     bool FDatasmithCADWorkerImpl::Run

Source code excerpt:

				break;

			case ECommandId::RunTask:
				ProcessCommand(*StaticCast<FRunTaskCommand*>(Command.Get()));
				break;

			case ECommandId::ImportParams:
				ProcessCommand(*StaticCast<FImportParametersCommand*>(Command.Get()));
				break;

#Loc: <Workspace>/Engine/Source/Programs/InterchangeWorker/Private/InterchangeWorkerImpl.cpp:89

Scope (from outer to inner):

file
function     bool FInterchangeWorkerImpl::Run

Source code excerpt:

					break;

				case ECommandId::RunTask:
				{
					FScopeLock Lock(&TFinishThreadCriticalSection);
					//Use a randomGuid to generate thread unique name
					int32 UniqueID = (FPlatformTime::Cycles64() & 0x00000000EFFFFFFF);
					FString ThreadName = FString(TEXT("InterchangeWorkerCommand_")) + FString::FromInt(UniqueID);
					ActiveThreads.Add(ThreadName, Async(

#Loc: <Workspace>/Engine/Source/Runtime/ImageWriteQueue/Private/ImageWriteQueue.cpp:164

Scope (from outer to inner):

file
class        class FQueuedImageWrite : public IQueuedWork
function     void RunTaskOnCurrentThread

Source code excerpt:

	{
		// Perform any compression, conversion and pixel processing, then write the image to disk
		bool bSuccess = Task->RunTask();

		Promise.SetValue(bSuccess);

		// Inform the owning queue that a task was completed with this task's fence ID
		Owner->OnTaskCompleted(FenceID);
		delete this;

#Loc: <Workspace>/Engine/Source/Runtime/ImageWriteQueue/Private/ImageWriteTask.cpp:12

Scope (from outer to inner):

file
function     bool FImageWriteTask::RunTask

Source code excerpt:

#include "IImageWrapperModule.h"

bool FImageWriteTask::RunTask()
{
	bool bSuccess = WriteToDisk();

	if (OnCompleted)
	{
		AsyncTask(ENamedThreads::GameThread, [bSuccess, LocalOnCompleted = MoveTemp(OnCompleted)] { LocalOnCompleted(bSuccess); });

#Loc: <Workspace>/Engine/Source/Runtime/ImageWriteQueue/Public/ImageWriteTask.h:36

Scope (from outer to inner):

file
class        class IImageWriteTaskBase

Source code excerpt:

	 * 
	 */
	virtual bool RunTask() = 0;

	/**
	 * 
	 */
	virtual void OnAbandoned() = 0;
};

#Loc: <Workspace>/Engine/Source/Runtime/ImageWriteQueue/Public/ImageWriteTask.h:78

Scope (from outer to inner):

file
class        class FImageWriteTask : public IImageWriteTaskBase

Source code excerpt:

public:

	IMAGEWRITEQUEUE_API virtual bool RunTask() override final;
	IMAGEWRITEQUEUE_API virtual void OnAbandoned() override final;

	IMAGEWRITEQUEUE_API void AddPreProcessorToSetAlphaOpaque();

private:

#Loc: <Workspace>/Engine/Source/Runtime/Online/BuildPatchServices/Private/BuildPatchInstaller.cpp:618

Scope (from outer to inner):

file
namespace    BuildPatchServices
function     bool FBuildPatchInstaller::StartInstallation

Source code excerpt:

			// Start thread!
			Thread = Configuration.SharedContext->CreateThread();
			Thread->RunTask([this]{ Run(); });

			StartDelegate.ExecuteIfBound(AsShared());
		}
		return Thread != nullptr;
	}

#Loc: <Workspace>/Engine/Source/Runtime/Online/BuildPatchServices/Private/Installer/ChunkDbChunkSource.cpp:226

Scope (from outer to inner):

file
namespace    BuildPatchServices
function     FChunkDbChunkSource::FChunkDbChunkSource

Source code excerpt:

			Future = Promise.GetFuture();
			Thread = Configuration.SharedContext->CreateThread();
			Thread->RunTask([this]() { ThreadRun(); });
		}
	}

	FChunkDbChunkSource::~FChunkDbChunkSource()
	{
		Abort();

#Loc: <Workspace>/Engine/Source/Runtime/Online/BuildPatchServices/Private/Installer/CloudChunkSource.cpp:259

Scope (from outer to inner):

file
namespace    BuildPatchServices
function     FCloudChunkSource::FCloudChunkSource

Source code excerpt:

			check(Configuration.SharedContext);
			Thread = Configuration.SharedContext->CreateThread();
			Thread->RunTask([this]() { ThreadRun(); });
		}
	}

	FCloudChunkSource::~FCloudChunkSource()
	{
		bShouldAbort = true;

#Loc: <Workspace>/Engine/Source/Runtime/Online/BuildPatchServices/Private/Installer/DiskChunkStore.cpp:75

Scope (from outer to inner):

file
namespace    BuildPatchServices
function     FDiskChunkStore::FDiskChunkStore

Source code excerpt:

		IoThreadFuture = IoThreadPromise.GetFuture();
		Thread = Configuration.SharedContext->CreateThread();
		Thread->RunTask([this]() { IoThread(); });
	}

	FDiskChunkStore::~FDiskChunkStore()
	{
		// Signal running loops to exit.
		bShouldRun = false;

#Loc: <Workspace>/Engine/Source/Runtime/Online/BuildPatchServices/Private/Installer/InstallerSharedContext.cpp:43

Scope (from outer to inner):

file
namespace    BuildPatchServices
function     void FBuildInstallerThread::RunTask

Source code excerpt:

	}

	void FBuildInstallerThread::RunTask(TUniqueFunction<void()> InTask)
	{
		check(InTask);

		MsgQueue.Enqueue(MoveTemp(InTask), EMsg::RunTask);

		DoWorkEvent->Trigger();
	}

	uint32 FBuildInstallerThread::Run()
	{

#Loc: <Workspace>/Engine/Source/Runtime/Online/BuildPatchServices/Private/Installer/InstallerSharedContext.cpp:63

Scope (from outer to inner):

file
namespace    BuildPatchServices
function     uint32 FBuildInstallerThread::Run

Source code excerpt:

			while (MsgQueue.Dequeue(Msg))
			{
				if (EnumHasAnyFlags(Msg.Msg, EMsg::RunTask))
				{
					check(!bExit);
					Msg.Task();
				}

				if (EnumHasAnyFlags(Msg.Msg, EMsg::Exit))

#Loc: <Workspace>/Engine/Source/Runtime/Online/BuildPatchServices/Private/Installer/InstallerSharedContext.h:18

Scope (from outer to inner):

file
namespace    BuildPatchServices
class        class FBuildInstallerThread : public IBuildInstallerThread , public FRunnable

Source code excerpt:

		{
			None = 0,
			RunTask = (1 << 0),
			Exit = (1 << 1)
		};
		FRIEND_ENUM_CLASS_FLAGS(EMsg);

		struct FMsg
		{

#Loc: <Workspace>/Engine/Source/Runtime/Online/BuildPatchServices/Private/Installer/InstallerSharedContext.h:41

Scope (from outer to inner):

file
namespace    BuildPatchServices
class        class FBuildInstallerThread : public IBuildInstallerThread , public FRunnable

Source code excerpt:


		// IBuildInstallerThread interface begin
		virtual void RunTask(TUniqueFunction<void()> Task) override;
		// IBuildInstallerThread interface end

		// FRunnable interface begin
		virtual uint32 Run() override;
		virtual void Stop() override;
		// FRunnable interface end

#Loc: <Workspace>/Engine/Source/Runtime/Online/BuildPatchServices/Public/Interfaces/IBuildInstallerSharedContext.h:22

Scope (from outer to inner):

file
namespace    BuildPatchServices
class        class IBuildInstallerThread

Source code excerpt:

		 * Adds a task to the thread's queue
		 */
		virtual void RunTask(TUniqueFunction<void()> Task) = 0;
	};
}

/**
 * An interface for sharing threads and components between multiple BPS installers
 */