refactor project structure

This commit is contained in:
hdt3213
2021-05-02 14:54:42 +08:00
parent bb9c140653
commit f29298cc68
78 changed files with 140 additions and 140 deletions

17
lib/sync/atomic/bool.go Normal file
View File

@@ -0,0 +1,17 @@
package atomic
import "sync/atomic"
type AtomicBool uint32
func (b *AtomicBool) Get() bool {
return atomic.LoadUint32((*uint32)(b)) != 0
}
func (b *AtomicBool) Set(v bool) {
if v {
atomic.StoreUint32((*uint32)(b), 1)
} else {
atomic.StoreUint32((*uint32)(b), 0)
}
}