virtcontainers/api: use RW lock to update containers

When a container is updated, those modifications are stored, to
avoid race conditions with other operations, a RW lock should be used.

fixes #346

Signed-off-by: Julio Montes <julio.montes@intel.com>
This commit is contained in:
Julio Montes 2018-05-30 16:04:11 -05:00
parent 9fb0b337ef
commit 7d435b84f0

View File

@ -615,7 +615,7 @@ func UpdateContainer(sandboxID, containerID string, resources specs.LinuxResourc
return errNeedContainerID return errNeedContainerID
} }
lockFile, err := rLockSandbox(sandboxID) lockFile, err := rwLockSandbox(sandboxID)
if err != nil { if err != nil {
return err return err
} }