Skip to content

Commit

Permalink
cleanup: remove SetDead function
Browse files Browse the repository at this point in the history
Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
  • Loading branch information
tao12345666333 committed Aug 25, 2019
1 parent cd1356d commit f8f6f7c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
7 changes: 0 additions & 7 deletions container/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 3 additions & 1 deletion container/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit f8f6f7c

Please sign in to comment.