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

Method LockChunks

Source/Engine/Content/Storage/FlaxStorage.cpp:264–278  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262}
263
264void FlaxStorage::LockChunks()
265{
266RETRY:
267 Platform::InterlockedIncrement(&_chunksLock);
268 if (Platform::AtomicRead(&_isUnloadingData) != 0)
269 {
270 // Someone else is closing file handles or freeing chunks so wait for it to finish and retry
271 Platform::InterlockedDecrement(&_chunksLock);
272 do
273 {
274 Platform::Sleep(1);
275 } while (Platform::AtomicRead(&_isUnloadingData) != 0);
276 goto RETRY;
277 }
278}
279
280FlaxStorage::LockData FlaxStorage::LockSafe()
281{

Callers 5

LoadMeshMethod · 0.80
ExtractDataMethod · 0.80
LockDataMethod · 0.80
LockDataClass · 0.80
GetStorageMethod · 0.80

Calls 3

InterlockedIncrementFunction · 0.50
AtomicReadFunction · 0.50
InterlockedDecrementFunction · 0.50

Tested by

no test coverage detected