diff --git a/container/state.go b/container/state.go index be403ae7d3..59eafc9171 100644 --- a/container/state.go +++ b/container/state.go @@ -366,13 +366,6 @@ func (s *State) IsRemovalInProgress() bool { return res } -// SetDead sets the container state to "dead" -func (s *State) SetDead() { - s.Lock() - s.Dead = true - s.Unlock() -} - // IsDead returns whether the Dead flag is set. Used by Container to check whether a container is dead. func (s *State) IsDead() bool { s.Lock() diff --git a/container/state_test.go b/container/state_test.go index 4ad3c805ed..bf114ea1aa 100644 --- a/container/state_test.go +++ b/container/state_test.go @@ -109,7 +109,9 @@ func TestStateRunStop(t *testing.T) { } // Set the state to dead and removed. - s.SetDead() + s.Lock() + s.Dead = true + s.Unlock() s.SetRemoved() // Wait for removed status or timeout.