Merge pull request #21677 from aaronlehmann/layer-store-locking
Fix layer store Get locking Upstream-commit: 156c5db889b29e28e0176019b1996af4a5465a77 Component: engine
This commit is contained in:
@@ -334,7 +334,10 @@ func (ls *layerStore) get(l ChainID) *roLayer {
|
||||
}
|
||||
|
||||
func (ls *layerStore) Get(l ChainID) (Layer, error) {
|
||||
layer := ls.get(l)
|
||||
ls.layerL.Lock()
|
||||
defer ls.layerL.Unlock()
|
||||
|
||||
layer := ls.getWithoutLock(l)
|
||||
if layer == nil {
|
||||
return nil, ErrLayerDoesNotExist
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user