UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
AsyncLoadingThread.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3/*=============================================================================
4 AsyncLoadingThread.h: Unreal async loading code.
5=============================================================================*/
6#pragma once
7
8#include "CoreMinimal.h"
9#include "Algo/AnyOf.h"
14#include "Misc/ScopeLock.h"
15#include "Misc/CommandLine.h"
16#include "Misc/App.h"
17#include "HAL/Runnable.h"
18#include "HAL/ThreadSafeBool.h"
19#include "Misc/ConfigCacheIni.h"
22#include "AutoRTFM.h"
23
24#include <atomic>
25
27
75
78{
79 //FCriticalSection AsyncLoadEventQueueCritical; //@todoio maybe this doesn't need to be protected by a critical section.
82
87
88 FORCEINLINE void AddAsyncEvent(int32 UserPriority, int32 PackageSerialNumber, int32 EventSystemPriority, TFunction<void(FAsyncLoadEventArgs& Args)>&& Payload)
89 {
90 //UE::TScopeLock Lock(AsyncLoadEventQueueCritical);
91 //@todoio check(FAsyncLoadingThread::IsInAsyncLoadThread());
92 EventQueue.HeapPush(FAsyncLoadEvent(UserPriority, PackageSerialNumber, EventSystemPriority, ++RunningSerialNumber, Forward<TFunction<void(FAsyncLoadEventArgs& Args)>>(Payload)));
93 }
95 {
97 bool bResult = false;
98 {
99 //UE::TScopeLock Lock(AsyncLoadEventQueueCritical);
100 //@todoio check(FAsyncLoadingThread::IsInAsyncLoadThread());
101 if (EventQueue.Num())
102 {
104 bResult = true;
105 }
106 }
107 if (bResult)
108 {
109 Event.Payload(Args);
110 }
111 return bResult;
112 }
113};
114
115// Shared data for FFlushRequest
117{
119 : RequestIDs(MakeUnique<std::atomic<int32>[]>(InRequestIDs.Num()))
120 , NumRequests(InRequestIDs.Num())
121 {
122 for (int32 i=0; i < InRequestIDs.Num(); ++i)
123 {
124 RequestIDs.Get()[i] = InRequestIDs[i];
125 }
126 }
127
129 {
130 return MakeArrayView(RequestIDs.Get(), NumRequests);
131 }
132
134 {
135 return MakeArrayView(RequestIDs.Get(), NumRequests);
136 }
137
139 {
140 for (std::atomic<int32>& RequestID : GetRequestIDs())
141 {
142 if (RequestID.load(std::memory_order_relaxed) == InCompletedRequest)
143 {
144 ++NumCompletedRequests;
145 }
146 }
147 }
148
150 {
151 return NumRequests == NumCompletedRequests;
152 }
153
154private:
163 TUniquePtr<std::atomic<int32>[]> RequestIDs;
164 int32 NumRequests;
165 int32 NumCompletedRequests = 0;
166};
167
172{
173 FFlushRequest() = default;
174
179
181 {
182 return Data->GetRequestIDs();
183 }
184
185 bool IsValid() const
186 {
187 return Data.IsValid();
188 }
189
190 bool IsComplete() const
191 {
192 return Data->IsComplete();
193 }
194
195 operator bool() const
196 {
197 return IsValid();
198 }
199
200private:
201 void OnRequestComplete(int32 RequestID)
202 {
203 Data->OnRequestComplete(RequestID);
204 }
205
206 void AdjustRequestIDs(TMap<int32, int32>& DuplicateRequestMap)
207 {
208 for (std::atomic<int32>& RequestID : Data->GetRequestIDs())
209 {
210 if (int32* MainRequest = DuplicateRequestMap.Find(RequestID.load(std::memory_order_relaxed)))
211 {
212 RequestID.store(*MainRequest, std::memory_order_relaxed);
213 }
214 }
215 }
216
218
220};
221
226{
227 static int32 Value;
228 static void Init();
229};
230
235{
236 friend struct FAsyncPackage;
237
238 struct FEDLBootNotificationManager& EDLBootNotificationManager;
239
243 FThreadSafeCounter StopTaskCounter;
244
246 static bool bThreadStarted;
247
249 FEvent* QueuedRequestsEvent;
251 FEvent* CancelLoadingEvent;
253 FEvent* ThreadSuspendedEvent;
255 FEvent* ThreadResumedEvent;
257 TArray<FAsyncPackageDesc*> QueuedPackages;
258#if THREADSAFE_UOBJECTS
261#endif
263 FThreadSafeBool bShouldCancelLoading;
265 FThreadSafeCounter IsLoadingSuspended;
267 TArray<FAsyncPackage*> LoadedPackages;
268 TMap<FName, FAsyncPackage*> LoadedPackagesNameLookup;
269#if THREADSAFE_UOBJECTS
272#endif
274 TArray<FAsyncPackage*> LoadedPackagesToProcess;
275 TArray<FAsyncPackage*> PackagesToDelete;
276 TMap<FName, FAsyncPackage*> LoadedPackagesToProcessNameLookup;
277#if WITH_EDITOR
279#endif
280#if THREADSAFE_UOBJECTS
285#endif
286
291#if THREADSAFE_UOBJECTS
294#endif
296 TMap<int32, int32> DuplicateRequestMap;
297
299 TArray<FAsyncPackage*> AsyncPackages;
300 TMap<FName, FAsyncPackage*> AsyncPackageNameLookup;
301public:
304private:
305
306#if THREADSAFE_UOBJECTS
309#endif
310
312 TSet<int32> PendingRequests;
313#if THREADSAFE_UOBJECTS
315 FCriticalSection PendingRequestsCritical;
316#endif
317
319 FThreadSafeCounter QueuedPackagesCounter;
321 FThreadSafeCounter ExistingAsyncPackagesCounter;
322
323 FThreadSafeCounter AsyncThreadReady;
324
326 TArray<FAsyncPackageDesc*> QueuedPackagesToCancel;
328 TSet<FAsyncPackage*> PackagesToCancel;
329
331 static uint32 AsyncLoadingThreadID;
332
334 enum class EAsyncPackageInsertMode
335 {
336 InsertBeforeMatchingPriorities, // Insert this package before all other packages of the same priority
337 InsertAfterMatchingPriorities // Insert this package after all other packages of the same priority
338 };
339
340#if LOOKING_FOR_PERF_ISSUES
343#endif
344
345 IAsyncPackageLoader* IoStorePackageLoader = nullptr;
346
347public:
348
350 virtual ~FAsyncLoadingThread();
351
352 virtual ELoaderType GetLoaderType() const override
353 {
355 }
356
358 {
359 return IoStorePackageLoader;
360 }
361
366
367 //~ Begin FRunnable Interface.
368 virtual bool Init();
369 virtual uint32 Run();
370 virtual void Stop();
371 //~ End FRunnable Interface
372
375 {
377 return *Instance;
378 }
379
381 void StartThread() override;
382
384
386
395 uint32 InLoadFlags) override;
396
397 EAsyncPackageState::Type ProcessLoading(bool bUseTimeLimit, bool bUseFullTimeLimit, double TimeLimit) override;
398
400
401 void FlushLoading(TConstArrayView<int32> RequestIDs) override;
402
404
405 void NotifyUnreachableObjects(const TArrayView<FUObjectItem*>& UnreachableObjects) override {};
406
408
409 void NotifyRegistrationEvent(FName PackageName, FName Name, ENotifyRegistrationType NotifyRegistrationType, ENotifyRegistrationPhase NotifyRegistrationPhase, UObject* (*InRegister)(), bool InbDynamic, UObject* FinishedObject) override;
410
411 void NotifyRegistrationComplete() override;
412
415
418 {
419 if (Ptr.PackageName != NAME_None && Ptr.SerialNumber)
420 {
422 if (Package && Package->SerialNumber == Ptr.SerialNumber)
423 {
424 return Package;
425 }
426 }
427 return nullptr;
428 }
429
431 void QueueEvent_CreateLinker(FAsyncPackage* Pkg, int32 EventSystemPriority = 0);
433 void QueueEvent_FinishLinker(FWeakAsyncPackagePtr WeakPtr, int32 EventSystemPriority = 0);
435 void QueueEvent_StartImportPackages(FAsyncPackage* Pkg, int32 EventSystemPriority = 0);
437 void QueueEvent_SetupImports(FAsyncPackage* Pkg, int32 EventSystemPriority = 0);
439 void QueueEvent_SetupExports(FAsyncPackage* Pkg, int32 EventSystemPriority = 0);
441 void QueueEvent_ProcessImportsAndExports(FAsyncPackage* Pkg, int32 EventSystemPriority = 0);
443 void QueueEvent_ExportsDone(FAsyncPackage* Pkg, int32 EventSystemPriority = 0);
445 void QueueEvent_ProcessPostloadWait(FAsyncPackage* Pkg, int32 EventSystemPriority = 0);
447 void QueueEvent_StartPostLoad(FAsyncPackage* Pkg, int32 EventSystemPriority = 0);
448
451 {
452 return bThreadStarted;
453 }
454
456 static void EnterAsyncLoadingTick(int32 ThreadIndex)
457 {
458 AsyncLoadingTickCounter.Increment();
459 check(CurrentAsyncLoadingTickThreadIndex == INDEX_NONE || CurrentAsyncLoadingTickThreadIndex == ThreadIndex);
460 CurrentAsyncLoadingTickThreadIndex = ThreadIndex;
461 }
462
463 static void LeaveAsyncLoadingTick(int32 ThreadIndex)
464 {
465 int32 AsyncLoadingTickCounterValue = AsyncLoadingTickCounter.Decrement();
467 check(CurrentAsyncLoadingTickThreadIndex == ThreadIndex);
469 {
470 CurrentAsyncLoadingTickThreadIndex = INDEX_NONE;
471 }
472 }
473
476 {
477 return !!AsyncLoadingTickCounter.GetValue();
478 }
479
481 {
482 return QueuedPackagesCounter.GetValue() != 0 || ExistingAsyncPackagesCounter.GetValue() != 0;
483 }
484
486 {
487 bool bResult = false;
488 if (IsMultithreaded())
489 {
490 // We still need to report we're in async loading thread even if
491 // we're on game thread but inside of async loading code (PostLoad mostly)
492 // to make it behave exactly like the non-threaded version
493 bResult = FPlatformTLS::GetCurrentThreadId() == AsyncLoadingThreadID ||
495 }
496 else
497 {
499 }
500 return bResult;
501 }
502
505 {
506 return !!IsLoadingSuspended.GetValue();
507 }
508
509 virtual bool IsAsyncLoadingSuspended() override
510 {
512 }
513
515 {
517 return IsLoadingSuspended.GetValue();
518 }
519
522 {
523 return QueuedPackagesCounter.GetValue();
524 }
525
528 {
529 return ExistingAsyncPackagesCounter.GetValue();
530 }
531
539 {
541 return AsyncPackageNameLookup.FindRef(PackageName);
542 }
543
550 void InsertPackage(FAsyncPackage* Package, bool bReinsert = false, EAsyncPackageInsertMode InsertMode = EAsyncPackageInsertMode::InsertBeforeMatchingPriorities);
551
559 {
561 return LoadedPackagesNameLookup.FindRef(PackageName);
562 }
563
570
574 void CancelLoading() override;
575
579 void ShutdownLoading() override;
580
584 void SuspendLoading() override;
585
589 void ResumeLoading() override;
590
597 {
599 return AsyncPackages[PackageIndex];
600 }
601
613
617 void CheckForCycles();
618
628 EAsyncPackageState::Type TickAsyncLoading(bool bUseTimeLimit, bool bUseFullTimeLimit, double TimeLimit, FFlushRequest FlushRequest = FFlushRequest());
629
638 EAsyncPackageState::Type TickAsyncThread(bool bUseTimeLimit, bool bUseFullTimeLimit, double TimeLimit, bool& bDidSomething, FFlushRequest& FlushRequest);
639
641 void InitializeLoading() override;
642
648 float GetAsyncLoadPercentage(const FName& PackageName) override;
649
650
651private:
655 void AddPendingRequest(int32 RequestID)
656 {
657#if THREADSAFE_UOBJECTS
658 UE::TScopeLock Lock(PendingRequestsCritical);
659#endif
660 if (!PendingRequests.Contains(RequestID))
661 {
662 PendingRequests.Add(RequestID);
663 }
664 }
665
669 void RemovePendingRequests(TArray<int32>& RequestIDs)
670 {
671#if THREADSAFE_UOBJECTS
672 UE::TScopeLock Lock(PendingRequestsCritical);
673#endif
674 for (int32 ID : RequestIDs)
675 {
676 PendingRequests.Remove(ID);
678 }
679 }
680
685 void CompleteFlushRequests(TArray<int32>& RequestIDs);
686
692 void MapDuplicateRequestID(int32 DuplicateRequestId, int32 MainRequestId);
693
694
696 int32 GetQueuedPackagesCount() const
697 {
698 return QueuedPackagesCounter.GetValue();
699 }
701 int32 GetExistingAsyncPackagesCount() const
702 {
703 return ExistingAsyncPackagesCounter.GetValue();
704 }
705
709 bool ContainsRequestInternal(int32 RequestID)
710 {
711#if THREADSAFE_UOBJECTS
712 UE::TScopeLock Lock(PendingRequestsCritical);
713#endif
714 return PendingRequests.Contains(RequestID);
715 }
716
720 bool ContainsAnyRequestInternal(TConstArrayView<int32> RequestIDs)
721 {
722#if THREADSAFE_UOBJECTS
723 UE::TScopeLock Lock(PendingRequestsCritical);
724#endif
725 return Algo::AnyOf(RequestIDs, [this](int32 RequestID){ return PendingRequests.Contains(RequestID); });
726 }
727
731 bool ContainsAnyRequestInternal(TConstArrayView<std::atomic<int32>> RequestIDs)
732 {
733#if THREADSAFE_UOBJECTS
734 UE::TScopeLock Lock(PendingRequestsCritical);
735#endif
736 return Algo::AnyOf(RequestIDs, [this](const std::atomic<int32>& RequestID){ return PendingRequests.Contains(RequestID.load(std::memory_order_relaxed)); });
737 }
738
745 FFlushRequest AddFlushRequest(TConstArrayView<int32> RequestIDs);
746
751 FFlushRequest PeekFlushRequest();
752
757 void AdjustFlushRequest(FFlushRequest& FlushRequest);
758
765 bool ShouldProcessPackage(FAsyncPackage* InAsyncPackage, const FFlushRequest& FlushRequest);
766
776 EAsyncPackageState::Type ProcessLoadedPackages(bool bUseTimeLimit, bool bUseFullTimeLimit, double TimeLimit, bool& bDidSomething, const FFlushRequest& FlushRequest);
777
781 int32 CreateAsyncPackagesFromQueue(bool bUseTimeLimit, bool bUseFullTimeLimit, double TimeLimit);
782
787 void ProcessAsyncPackageRequest(FAsyncPackageDesc* InRequest, FAsyncPackage* InRootPackage);
788
792 void UpdateExistingPackagePriorities(FAsyncPackage* InPackage, TAsyncLoadPriority InNewPriority);
793
799 FAsyncPackage* FindExistingPackageAndAddCompletionCallback(FAsyncPackageDesc* PackageRequest, TMap<FName, FAsyncPackage*>& PackageList);
800
804 void AddToLoadedPackages(FAsyncPackage* Package);
805
807 void CancelAsyncLoadingInternal();
808 void FinalizeCancelAsyncLoadingInternal();
809
811 FEventLoadGraph EventGraph;
813 FPrecacheCallbackHandler* PrecacheHandler;
815 int32 AsyncLoadingThreadIndex;
816
818 static FThreadSafeCounter AsyncLoadingTickCounter;
819 static int32 CurrentAsyncLoadingTickThreadIndex;
820
821public:
822
825 {
826 return EventGraph;
827 }
828
831 {
832 return *PrecacheHandler;
833 }
834
837 {
838 return AsyncLoadingThreadIndex;
839 }
840
841#if !UE_BUILD_SHIPPING && !UE_BUILD_TEST
843#endif
844
846};
OODEFFUNC typedef void(OODLE_CALLBACK t_fp_OodleCore_Plugin_Free)(void *ptr)
#define FORCEINLINE
Definition AndroidPlatform.h:140
constexpr auto MakeArrayView(OtherRangeType &&Other)
Definition ArrayView.h:873
#define checkSlow(expr)
Definition AssertionMacros.h:332
#define check(expr)
Definition AssertionMacros.h:314
ENotifyRegistrationPhase
Definition AsyncLoadingEvents.h:23
ENotifyRegistrationType
Definition AsyncLoadingEvents.h:13
#define UE_AUTORTFM_ALWAYS_OPEN
Definition AutoRTFMDefines.h:114
ELoaderType
Definition CoreGlobals.h:485
@ INDEX_NONE
Definition CoreMiscDefines.h:150
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
TSharedRef< InObjectType, InMode > MakeShared(InArgTypes &&... Args)
Definition SharedPointer.h:2009
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
UE::FPlatformRecursiveMutex FCriticalSection
Definition CriticalSection.h:53
#define TRACE_LOADTIME_END_REQUEST(...)
Definition LoadTimeTracePrivate.h:135
@ Num
Definition MetalRHIPrivate.h:234
const bool
Definition NetworkReplayStreaming.h:178
#define MAX_int32
Definition NumericLimits.h:25
EPackageFlags
Definition ObjectMacros.h:129
CORE_API bool IsInGameThread()
Definition ThreadingBase.cpp:185
int32 TAsyncLoadPriority
Definition UObjectGlobals.h:726
UE_FORCEINLINE_HINT TUniquePtr< T > MakeUnique(TArgs &&... Args)
Definition UniquePtr.h:918
FRWLock Lock
Definition UnversionedPropertySerialization.cpp:921
uint32_t uint32
Definition binka_ue_file_header.h:6
Definition AsyncLoadingThread.h:235
void QueueEvent_ProcessPostloadWait(FAsyncPackage *Pkg, int32 EventSystemPriority=0)
Definition AsyncLoading.cpp:2699
virtual bool IsAsyncLoadingSuspended() override
Definition AsyncLoadingThread.h:509
EAsyncPackageState::Type ProcessAsyncLoading(int32 &OutPackagesProcessed, bool bUseTimeLimit, bool bUseFullTimeLimit, float TimeLimit, FFlushRequest &FlushRequest)
Definition AsyncLoading.cpp:4326
void SetIoStorePackageLoader(IAsyncPackageLoader *InIoStorePackageLoader)
Definition AsyncLoadingThread.h:362
void InitializeLoading() override
Definition AsyncLoading.cpp:823
FAsyncLoadEventQueue EventQueue
Definition AsyncLoadingThread.h:414
FORCEINLINE bool IsAsyncLoadingSuspendedInternal() const
Definition AsyncLoadingThread.h:504
static void EnterAsyncLoadingTick(int32 ThreadIndex)
Definition AsyncLoadingThread.h:456
void ShutdownLoading() override
Definition AsyncLoading.cpp:5152
int32 GetThreadIndex() const
Definition AsyncLoadingThread.h:836
void QueueEvent_StartPostLoad(FAsyncPackage *Pkg, int32 EventSystemPriority=0)
Definition AsyncLoading.cpp:2741
FORCEINLINE int32 GetNumQueuedPackages() override
Definition AsyncLoadingThread.h:521
void QueueEvent_FinishLinker(FWeakAsyncPackagePtr WeakPtr, int32 EventSystemPriority=0)
Definition AsyncLoading.cpp:1854
virtual ~FAsyncLoadingThread()
Definition AsyncLoading.cpp:5144
void QueueEvent_SetupImports(FAsyncPackage *Pkg, int32 EventSystemPriority=0)
Definition AsyncLoading.cpp:2303
TArray< FAsyncPackage * > AsyncPackagesReadyForTick
Definition AsyncLoadingThread.h:303
void QueuePackage(FAsyncPackageDesc &Package)
Definition AsyncLoading.cpp:828
void StartThread() override
Definition AsyncLoading.cpp:5176
virtual void Stop()
Definition AsyncLoading.cpp:5348
static FAsyncLoadingThread * Instance
Definition AsyncLoadingThread.h:845
FPrecacheCallbackHandler & GetPrecacheHandler()
Definition AsyncLoadingThread.h:830
void InsertPackage(FAsyncPackage *Package, bool bReinsert=false, EAsyncPackageInsertMode InsertMode=EAsyncPackageInsertMode::InsertBeforeMatchingPriorities)
Definition AsyncLoading.cpp:4210
FEventLoadGraph & GetEventGraph()
Definition AsyncLoadingThread.h:824
float GetAsyncLoadPercentage(const FName &PackageName) override
Definition AsyncLoading.cpp:5513
FORCEINLINE FAsyncPackage * GetPackage(FWeakAsyncPackagePtr Ptr)
Definition AsyncLoadingThread.h:417
void FireCompletedCompiledInImport(void *AsyncPacakge, FPackageIndex Import)
Definition AsyncLoading.cpp:5597
void SuspendLoading() override
Definition AsyncLoading.cpp:5484
FThreadSafeCounter RecursionNotAllowed
Definition AsyncLoadingThread.h:842
FORCEINLINE FAsyncPackage * GetPackage(int32 PackageIndex)
Definition AsyncLoadingThread.h:596
void NotifyRegistrationComplete() override
Definition AsyncLoading.cpp:5592
void FlushLoading(TConstArrayView< int32 > RequestIDs) override
Definition AsyncLoading.cpp:7522
void QueueEvent_SetupExports(FAsyncPackage *Pkg, int32 EventSystemPriority=0)
Definition AsyncLoading.cpp:2642
void NotifyUnreachableObjects(const TArrayView< FUObjectItem * > &UnreachableObjects) override
Definition AsyncLoadingThread.h:405
void QueueEvent_CreateLinker(FAsyncPackage *Pkg, int32 EventSystemPriority=0)
Definition AsyncLoading.cpp:1788
void QueueEvent_ExportsDone(FAsyncPackage *Pkg, int32 EventSystemPriority=0)
Definition AsyncLoading.cpp:2720
virtual ELoaderType GetLoaderType() const override
Definition AsyncLoadingThread.h:352
FORCEINLINE FAsyncPackage * FindAsyncPackage(const FName &PackageName)
Definition AsyncLoadingThread.h:538
FORCEINLINE int32 GetAsyncLoadingSuspendedCount()
Definition AsyncLoadingThread.h:514
void NotifyConstructedDuringAsyncLoading(UObject *Object, bool bSubObject) override
Definition AsyncLoading.cpp:5555
EAsyncPackageState::Type ProcessLoading(bool bUseTimeLimit, bool bUseFullTimeLimit, double TimeLimit) override
Definition AsyncLoading.cpp:7625
FORCEINLINE bool IsInAsyncLoadThread() override
Definition AsyncLoadingThread.h:485
EAsyncPackageState::Type ProcessLoadingUntilComplete(TFunctionRef< bool()> CompletionPredicate, double TimeLimit) override
Definition AsyncLoading.cpp:7582
EAsyncPackageState::Type TickAsyncLoading(bool bUseTimeLimit, bool bUseFullTimeLimit, double TimeLimit, FFlushRequest FlushRequest=FFlushRequest())
Definition AsyncLoading.cpp:4975
EAsyncPackageState::Type TickAsyncThread(bool bUseTimeLimit, bool bUseFullTimeLimit, double TimeLimit, bool &bDidSomething, FFlushRequest &FlushRequest)
Definition AsyncLoading.cpp:5276
void NotifyRegistrationEvent(FName PackageName, FName Name, ENotifyRegistrationType NotifyRegistrationType, ENotifyRegistrationPhase NotifyRegistrationPhase, UObject *(*InRegister)(), bool InbDynamic, UObject *FinishedObject) override
Definition AsyncLoading.cpp:5587
void ResumeLoading() override
Definition AsyncLoading.cpp:5498
static FAsyncLoadingThread & Get()
Definition AsyncLoadingThread.h:374
UE_AUTORTFM_ALWAYS_OPEN bool IsAsyncLoadingPackages() override
Definition AsyncLoadingThread.h:480
bool ShouldAlwaysLoadPackageAsync(const FPackagePath &InPackagePath) override
Definition AsyncLoading.cpp:7441
void CancelLoading() override
Definition AsyncLoading.cpp:5353
void CheckForCycles()
Definition AsyncLoading.cpp:5246
FORCEINLINE bool IsMultithreaded() override
Definition AsyncLoadingThread.h:450
static void LeaveAsyncLoadingTick(int32 ThreadIndex)
Definition AsyncLoadingThread.h:463
FORCEINLINE FAsyncPackage * FindLoadedPackage(const FName &PackageName)
Definition AsyncLoadingThread.h:558
virtual uint32 Run()
Definition AsyncLoading.cpp:5199
static UE_AUTORTFM_ALWAYS_OPEN bool GetIsInAsyncLoadingTick()
Definition AsyncLoadingThread.h:475
FORCEINLINE int32 GetNumAsyncPackages() override
Definition AsyncLoadingThread.h:527
virtual bool Init()
Definition AsyncLoading.cpp:5194
IAsyncPackageLoader * GetIoStorePackageLoader() const
Definition AsyncLoadingThread.h:357
void QueueEvent_StartImportPackages(FAsyncPackage *Pkg, int32 EventSystemPriority=0)
Definition AsyncLoading.cpp:2005
void QueueEvent_ProcessImportsAndExports(FAsyncPackage *Pkg, int32 EventSystemPriority=0)
Definition AsyncLoading.cpp:2678
Definition Event.h:21
Definition LinkerInstancingContext.h:99
Definition NameTypes.h:617
Definition ObjectResource.h:44
Definition PackagePath.h:89
Definition RunnableThread.h:20
Definition Runnable.h:20
Definition ThreadSafeBool.h:17
Definition ThreadSafeCounter.h:14
int32 Increment()
Definition ThreadSafeCounter.h:52
int32 Decrement()
Definition ThreadSafeCounter.h:75
int32 GetValue() const
Definition ThreadSafeCounter.h:120
Definition AsyncPackageLoader.h:88
Definition ArrayView.h:139
Definition Array.h:670
UE_REWRITE SizeType Num() const
Definition Array.h:1144
SizeType HeapPush(ElementType &&InItem, const PREDICATE_CLASS &Predicate)
Definition Array.h:3671
void HeapPop(ElementType &OutItem, const PREDICATE_CLASS &Predicate, EAllowShrinking AllowShrinking=UE::Core::Private::AllowShrinkingByDefault< AllocatorType >())
Definition Array.h:3748
Definition AssetRegistryState.h:50
Definition AndroidPlatformMisc.h:14
Definition UnrealString.h.inl:34
Definition SharedPointer.h:692
UE_FORCEINLINE_HINT const bool IsValid() const
Definition SharedPointer.h:1085
Definition UniquePtr.h:107
UE_FORCEINLINE_HINT T * Get() const
Definition UniquePtr.h:324
Definition ScopeLock.h:21
Definition Object.h:95
UE_REWRITE bool AnyOf(const RangeType &Range)
Definition AnyOf.h:20
Type
Definition UObjectGlobals.h:1141
static UE_FORCEINLINE_HINT void MemoryBarrier()
Definition AndroidPlatformMisc.h:249
static uint32 GetCurrentThreadId(void)
Definition AndroidPlatformTLS.h:20
Definition AsyncLoading.h:309
Definition AsyncLoadingThread.h:78
bool PopAndExecute(FAsyncLoadEventArgs &Args)
Definition AsyncLoadingThread.h:94
FORCEINLINE void AddAsyncEvent(int32 UserPriority, int32 PackageSerialNumber, int32 EventSystemPriority, TFunction< void(FAsyncLoadEventArgs &Args)> &&Payload)
Definition AsyncLoadingThread.h:88
int32 RunningSerialNumber
Definition AsyncLoadingThread.h:80
TArray< FAsyncLoadEvent > EventQueue
Definition AsyncLoadingThread.h:81
FAsyncLoadEventQueue()
Definition AsyncLoadingThread.h:83
Definition AsyncLoadingThread.h:30
@ EventSystemPriority_MAX
Definition AsyncLoadingThread.h:33
int32 PackageSerialNumber
Definition AsyncLoadingThread.h:37
int32 EventSystemPriority
Definition AsyncLoadingThread.h:38
int32 SerialNumber
Definition AsyncLoadingThread.h:39
TFunction< void(FAsyncLoadEventArgs &Args)> Payload
Definition AsyncLoadingThread.h:40
int32 UserPriority
Definition AsyncLoadingThread.h:36
FAsyncLoadEvent()
Definition AsyncLoadingThread.h:42
FORCEINLINE bool operator<(const FAsyncLoadEvent &Other) const
Definition AsyncLoadingThread.h:58
FAsyncLoadEvent(int32 InUserPriority, int32 InPackageSerialNumber, int32 InEventSystemPriority, int32 InSerialNumber, TFunction< void(FAsyncLoadEventArgs &Args)> &&InPayload)
Definition AsyncLoadingThread.h:49
Definition AsyncPackage.h:18
Definition AsyncLoading.h:345
Definition AsyncLoading.cpp:118
Definition AsyncLoading.h:290
Definition AsyncLoadingThread.h:117
void OnRequestComplete(int32 InCompletedRequest)
Definition AsyncLoadingThread.h:138
TConstArrayView< std::atomic< int32 > > GetRequestIDs() const
Definition AsyncLoadingThread.h:128
bool IsComplete()
Definition AsyncLoadingThread.h:149
FFlushRequestData(TConstArrayView< int32 > InRequestIDs)
Definition AsyncLoadingThread.h:118
TArrayView< std::atomic< int32 > > GetRequestIDs()
Definition AsyncLoadingThread.h:133
Definition AsyncLoadingThread.h:172
bool IsValid() const
Definition AsyncLoadingThread.h:185
TConstArrayView< std::atomic< int32 > > GetRequestIDs() const
Definition AsyncLoadingThread.h:180
FFlushRequest(TConstArrayView< int32 > InRequestIDs)
Definition AsyncLoadingThread.h:175
FFlushRequest()=default
bool IsComplete() const
Definition AsyncLoadingThread.h:190
Definition UObjectGlobals.h:789
Definition AsyncLoadingThread.h:226
static void Init()
Definition AsyncLoading.cpp:5088
static int32 Value
Definition AsyncLoadingThread.h:227
Definition AsyncLoading.cpp:1483
Definition AsyncLoading.h:71
FName PackageName
Definition AsyncLoading.h:72
int32 SerialNumber
Definition AsyncLoading.h:73