0 Star 0 Fork 616

李明 / gf

forked from John / gf 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
uint32.go 715 Bytes
一键复制 编辑 原始数据 按行查看 历史
// Copyright 2018 gf Author(https://gitee.com/johng/gf). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://gitee.com/johng/gf.
package gtype
import (
"sync/atomic"
)
type Uint32 struct {
val uint32
}
func NewUint32(value...uint32) *Uint32 {
if len(value) > 0 {
return &Uint32{val:value[0]}
}
return &Uint32{}
}
func (t *Uint32)Set(value uint32) {
atomic.StoreUint32(&t.val, value)
}
func (t *Uint32)Val() uint32 {
return atomic.LoadUint32(&t.val)
}
func (t *Uint32)Add(delta uint32) uint32 {
return atomic.AddUint32(&t.val, delta)
}
Go
1
https://gitee.com/limingsky/gf.git
git@gitee.com:limingsky/gf.git
limingsky
gf
gf
c9a36a8224f1

搜索帮助