lib,oci: drop stateLock when possible
Should fix a possible deadlock in, at least, ListPodSandbox. There seems to be no reason to hold stateLock when doing operations on the memory_store for containers and sandboxes. Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
2fa1f3f74a
commit
ecc572e7cf
3 changed files with 14 additions and 35 deletions
|
@ -25,8 +25,9 @@ func (c *memoryStore) Add(id string, cont *Sandbox) {
|
|||
|
||||
// Get returns a sandbox from the store by id.
|
||||
func (c *memoryStore) Get(id string) *Sandbox {
|
||||
var res *Sandbox
|
||||
c.RLock()
|
||||
res := c.s[id]
|
||||
res = c.s[id]
|
||||
c.RUnlock()
|
||||
return res
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue