MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / GetValues

Method GetValues

Source/Engine/Threading/ThreadLocal.h:79–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

77
78 template<typename AllocationType = HeapAllocation>
79 void GetValues(Array<T, AllocationType>& result) const
80 {
81 for (int32 i = 0; i < MaxThreads; i++)
82 {
83 if (Platform::AtomicRead((int64 volatile*)&_staticBuckets[i].ThreadID) != 0)
84 result.Add(_staticBuckets[i].Value);
85 }
86#if THREAD_LOCAL_USE_DYNAMIC_BUCKETS
87 if (auto dynamicBuckets = (Bucket*)Platform::AtomicRead((intptr volatile*)&_dynamicBuckets))
88 {
89 for (int32 i = 0; i < DynamicMaxThreads; i++)
90 {
91 if (Platform::AtomicRead((int64 volatile*)&dynamicBuckets[i].ThreadID) != 0)
92 result.Add(dynamicBuckets[i].Value);
93 }
94 }
95#endif
96 }
97
98 void Clear()
99 {

Callers 1

GenerateMethod · 0.45

Calls 2

AtomicReadFunction · 0.50
AddMethod · 0.45

Tested by

no test coverage detected