Commit 92fe79ea authored by Jørgen Lind's avatar Jørgen Lind
Browse files

Move lock into parent scope to prevent unlocking before touching members

parent 3c467194
......@@ -369,6 +369,8 @@ bool VolumeDataStoreIOManager::PrepareReadChunk(const VolumeDataChunk &chunk, Er
std::string layerName = GetLayerName(*chunk.layer);
auto metadataManager = GetMetadataMangerForLayer(layerName);
std::unique_lock<std::mutex> lock(m_mutex);
if (metadataManager)
{
int pageIndex = (int)(chunk.index / metadataManager->GetMetadataStatus().m_chunkMetadataPageSize);
......@@ -380,7 +382,6 @@ bool VolumeDataStoreIOManager::PrepareReadChunk(const VolumeDataChunk &chunk, Er
assert(pageIndex == metadataPage->PageIndex());
std::unique_lock<std::mutex> lock(m_mutex);
if (metadataPage->transferError().code != 0)
{
error = metadataPage->transferError();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment