瀏覽代碼

cleanup: remove SetDead function

Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
Jintao Zhang 5 年之前
父節點
當前提交
f8f6f7c2a0
共有 2 個文件被更改,包括 3 次插入8 次删除
  1. 0 7
      container/state.go
  2. 3 1
      container/state_test.go

+ 0 - 7
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()

+ 3 - 1
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.