Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Brian Barran
Open VDS
Commits
92fe79ea
Commit
92fe79ea
authored
Aug 12, 2020
by
Jørgen Lind
Browse files
Move lock into parent scope to prevent unlocking before touching members
parent
3c467194
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/OpenVDS/VDS/VolumeDataStoreIOManager.cpp
View file @
92fe79ea
...
...
@@ -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
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment