summaryrefslogtreecommitdiff
path: root/libpod/runtime_pod_linux.go
diff options
context:
space:
mode:
authorMatthew Heon <mheon@redhat.com>2022-02-22 11:05:26 -0500
committerMatthew Heon <mheon@redhat.com>2022-02-22 11:05:26 -0500
commit4a60319ecb833fd4afd4ef32b3ca49c377a94b5c (patch)
treef132003f65fee6e2178f96c8a289ee97a41dfe5b /libpod/runtime_pod_linux.go
parentfab82a7c9ca3821c2b4496f9e9f6bfc8b2aff53d (diff)
downloadpodman-4a60319ecb833fd4afd4ef32b3ca49c377a94b5c.tar.gz
podman-4a60319ecb833fd4afd4ef32b3ca49c377a94b5c.tar.bz2
podman-4a60319ecb833fd4afd4ef32b3ca49c377a94b5c.zip
Remove the runtime lock
This primarily served to protect us against shutting down the Libpod runtime while operations (like creating a container) were happening. However, it was very inconsistently implemented (a lot of our longer-lived functions, like pulling images, just didn't implement it at all...) and I'm not sure how much we really care about this very-specific error case? Removing it also removes a lot of potential deadlocks, which is nice. [NO NEW TESTS NEEDED] Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'libpod/runtime_pod_linux.go')
-rw-r--r--libpod/runtime_pod_linux.go9
1 files changed, 0 insertions, 9 deletions
diff --git a/libpod/runtime_pod_linux.go b/libpod/runtime_pod_linux.go
index 7bc675af7..155ad5c2d 100644
--- a/libpod/runtime_pod_linux.go
+++ b/libpod/runtime_pod_linux.go
@@ -22,9 +22,6 @@ import (
// NewPod makes a new, empty pod
func (r *Runtime) NewPod(ctx context.Context, p specgen.PodSpecGenerator, options ...PodCreateOption) (_ *Pod, deferredErr error) {
- r.lock.Lock()
- defer r.lock.Unlock()
-
if !r.valid {
return nil, define.ErrRuntimeStopped
}
@@ -151,9 +148,6 @@ func (r *Runtime) NewPod(ctx context.Context, p specgen.PodSpecGenerator, option
// AddInfra adds the created infra container to the pod state
func (r *Runtime) AddInfra(ctx context.Context, pod *Pod, infraCtr *Container) (*Pod, error) {
- r.lock.Lock()
- defer r.lock.Unlock()
-
if !r.valid {
return nil, define.ErrRuntimeStopped
}
@@ -167,9 +161,6 @@ func (r *Runtime) AddInfra(ctx context.Context, pod *Pod, infraCtr *Container) (
// SavePod is a helper function to save the pod state from outside of libpod
func (r *Runtime) SavePod(pod *Pod) error {
- r.lock.Lock()
- defer r.lock.Unlock()
-
if !r.valid {
return define.ErrRuntimeStopped
}