Replace atomicBool with the standard library atomic.Bool
Signed-off-by: hang.jiang <hang.jiang@daocloud.io>
This commit is contained in:
		@@ -27,7 +27,6 @@ import (
 | 
			
		||||
	"path/filepath"
 | 
			
		||||
	"strings"
 | 
			
		||||
	"sync"
 | 
			
		||||
	"sync/atomic"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
	"github.com/containerd/containerd/errdefs"
 | 
			
		||||
@@ -54,20 +53,6 @@ func (s *safePid) get() int {
 | 
			
		||||
	return s.pid
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
type atomicBool int32
 | 
			
		||||
 | 
			
		||||
func (ab *atomicBool) set(b bool) {
 | 
			
		||||
	if b {
 | 
			
		||||
		atomic.StoreInt32((*int32)(ab), 1)
 | 
			
		||||
	} else {
 | 
			
		||||
		atomic.StoreInt32((*int32)(ab), 0)
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (ab *atomicBool) get() bool {
 | 
			
		||||
	return atomic.LoadInt32((*int32)(ab)) == 1
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// TODO(mlaventure): move to runc package?
 | 
			
		||||
func getLastRuntimeError(r *runc.Runc) (string, error) {
 | 
			
		||||
	if r.Log == "" {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user