Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
virtcontainers/api: use RW lock to update containers
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Julio Montes committed May 30, 2018
1 parent 9fb0b33 commit 7d435b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion virtcontainers/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ func UpdateContainer(sandboxID, containerID string, resources specs.LinuxResourc
return errNeedContainerID
}

lockFile, err := rLockSandbox(sandboxID)
lockFile, err := rwLockSandbox(sandboxID)
if err != nil {
return err
}
Expand Down

0 comments on commit 7d435b8

Please sign in to comment.